Skip to content

Commit

Permalink
[C-3597] Add ellipses to track tile titles (#7234)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjeffers authored Jan 18, 2024
1 parent eba9299 commit 62b8611
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
10 changes: 10 additions & 0 deletions packages/web/src/components/track/desktop/TrackTile.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@
padding: var(--unit-2) var(--unit-3) var(--unit-2) 18px;
}

.text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.topSection {
position: relative;
display: inline-flex;
Expand Down Expand Up @@ -152,6 +158,10 @@
margin-left: 6px;
}

.title {
width: 100%;
}

.isActive .title {
color: var(--primary);
}
Expand Down
5 changes: 4 additions & 1 deletion packages/web/src/components/track/desktop/TrackTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { DogEar } from 'components/dog-ear'
import { Link } from 'components/link'
import { ScheduledReleaseLabel } from 'components/scheduled-release-label/ScheduledReleaseLabel'
import Skeleton from 'components/skeleton/Skeleton'
import { Text } from 'components/typography'
import typeStyles from 'components/typography/typography.module.css'
import { useAuthenticatedClickCallback } from 'hooks/useAuthenticatedCallback'
import { useFlag } from 'hooks/useRemoteConfig'
Expand Down Expand Up @@ -328,7 +329,9 @@ const TrackTile = ({
className={styles.title}
onClick={onClickTitle}
>
{title}
<Text variant='inherit' className={styles.text}>
{title}
</Text>
{isPlaying ? (
<IconVolume className={styles.volumeIcon} />
) : null}
Expand Down
4 changes: 4 additions & 0 deletions packages/web/src/components/track/mobile/TrackTile.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@
color: inherit;
}

.artistPopover {
width: 100%;
}

.skeleton {
position: absolute;
top: 0;
Expand Down
5 changes: 4 additions & 1 deletion packages/web/src/components/track/mobile/TrackTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,10 @@ const TrackTile = (props: CombinedProps) => {
className={cn(fadeIn, styles.artist)}
color={isActive ? 'primary' : 'neutral'}
>
<ArtistPopover handle={artistHandle}>
<ArtistPopover
handle={artistHandle}
containerClassName={styles.artistPopover}
>
<Text variant='inherit' className={styles.text}>
{props.artistName}
</Text>
Expand Down

0 comments on commit 62b8611

Please sign in to comment.