From 469626b4c4bd073c5a7d139f20f45a988b041fa3 Mon Sep 17 00:00:00 2001 From: nukeop <12746779+nukeop@users.noreply.github.com> Date: Mon, 9 Sep 2024 00:51:59 +0200 Subject: [PATCH] Add a tooltip for artist's popular tracks with full track name --- .../ArtistView/PopularTracks/index.tsx | 44 +- .../ArtistView/PopularTracks/styles.scss | 8 + .../ArtistViewContainer.test.tsx.snap | 623 +++++++++--------- .../GridTrackTable/Cells/TitleCell.tsx | 9 +- .../ui/lib/components/StreamInfo/index.tsx | 1 - 5 files changed, 359 insertions(+), 326 deletions(-) diff --git a/packages/app/app/components/ArtistView/PopularTracks/index.tsx b/packages/app/app/components/ArtistView/PopularTracks/index.tsx index f5408adabe..0d1fe8fa8b 100644 --- a/packages/app/app/components/ArtistView/PopularTracks/index.tsx +++ b/packages/app/app/components/ArtistView/PopularTracks/index.tsx @@ -6,14 +6,13 @@ import { Button } from 'semantic-ui-react'; import { useTranslation } from 'react-i18next'; import { TFunction } from 'i18next'; +import { ArtistTopTrack } from '@nuclear/core/src/plugins/plugins.types'; +import { TextCell } from '@nuclear/ui/lib/components/GridTrackTable/Cells/TextCell'; +import { Track } from '@nuclear/ui/lib/types'; import trackRowStyles from '../../TrackRow/styles.scss'; -import styles from './styles.scss'; -import { ArtistTopTrack } from '@nuclear/core/src/plugins/plugins.types'; import TrackTableContainer from '../../../containers/TrackTableContainer'; -import TrackTableCell from '@nuclear/ui/lib/components/TrackTable/Cells/TrackTableCell'; -import { Cell, CellProps } from 'react-table'; -import { Track } from '@nuclear/ui/lib/types'; +import styles from './styles.scss'; type AddAllButtonProps = { handleAddAll: React.MouseEventHandler; @@ -71,8 +70,8 @@ const PopularTracks: React.FC = ({ const customColumns = useMemo(() => [{ id: PlaycountColumnId, Header: t('count'), - accessor: (track: Track) => track.playcount, - Cell: ({value, ...rest}: CellProps) => + accessor: (track: Track) => Number(track.playcount).toLocaleString(), + Cell: TextCell }], []); return ( @@ -86,19 +85,24 @@ const PopularTracks: React.FC = ({ handleAddAll={handleAddAll} t={t} /> - +
+ +
-