Skip to content

Commit

Permalink
fix: Only show single line for tracks without artists or albums
Browse files Browse the repository at this point in the history
  • Loading branch information
leinelissen committed Nov 13, 2022
1 parent 0ffc5b6 commit 7ed389e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
8 changes: 5 additions & 3 deletions src/screens/Music/overlays/NowPlaying/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ function NowPlaying() {
</ShadowWrapper>
<TrackNameContainer>
<Text numberOfLines={1}>{track.title}</Text>
<Text style={{ opacity: 0.5 }} numberOfLines={1}>
{track.artist}{track.album ? ` — ${track.album}` : ''}
</Text>
{(track.artist || track.album) && (
<Text style={{ opacity: 0.5 }} numberOfLines={1}>
{track.artist}{track.album ? ` — ${track.album}` : ''}
</Text>
)}
</TrackNameContainer>
<ActionButton>
<SelectActionButton />
Expand Down
14 changes: 8 additions & 6 deletions src/screens/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,14 @@ export default function Search() {
<Text numberOfLines={1}>
{trackName || album.Name}
</Text>
<HalfOpacity style={defaultStyles.text} numberOfLines={1}>
{type === 'AlbumArtist'
? `${t('album')}${album.AlbumArtist}`
: `${t('track')}${album.AlbumArtist}${album.Name}`
}
</HalfOpacity>
{(album.AlbumArtist || album.Name) && (
<HalfOpacity style={defaultStyles.text} numberOfLines={1}>
{type === 'AlbumArtist'
? `${t('album')}${album.AlbumArtist}`
: `${t('track')}${album.AlbumArtist}${album.Name}`
}
</HalfOpacity>
)}
</View>
<View style={{ marginLeft: 16 }}>
<DownloadIcon trackId={id} />
Expand Down
14 changes: 8 additions & 6 deletions src/screens/modals/Player/components/Queue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,14 @@ export default function Queue({ header }: Props) {
>
{track.title}
</Text>
<TextHalfOpacity
style={currentIndex === index ? { color: THEME_COLOR, fontWeight: '400' } : undefined}
numberOfLines={1}
>
{track.artist}{track.album && ' — ' + track.album}
</TextHalfOpacity>
{(track.artist || track.album) && (
<TextHalfOpacity
style={currentIndex === index ? { color: THEME_COLOR, fontWeight: '400' } : undefined}
numberOfLines={1}
>
{track.artist}{track.album && ' — ' + track.album}
</TextHalfOpacity>
)}
</View>
<View style={{ marginLeft: 'auto', marginRight: 8 }}>
<TextHalfOpacity
Expand Down

0 comments on commit 7ed389e

Please sign in to comment.