11import { Plural } from '@lingui/react/macro' ;
22import { useImperativeHandle , useRef } from 'react' ;
33
4+ import Scrollable from '../elements/Scrollable' ;
45import type { TrackGroup } from '../generated/typings' ;
56import useAllTracks from '../hooks/useAllTracks' ;
67import { parseDuration } from '../hooks/useFormattedDuration' ;
78import usePlayingTrackID from '../hooks/usePlayingTrackID' ;
89import type { TrackListVirtualizer } from '../types/museeks' ;
910import Cover from './Cover' ;
10- import styles from './TrackList .module.css' ;
11+ import styles from './TrackListGrouped .module.css' ;
1112import TrackRow , { type TrackRowEvents } from './TrackRow' ;
1213
1314/** ----------------------------------------------------------------------------
@@ -48,7 +49,7 @@ export default function TrackListGroupedLayout(props: Props) {
4849 } , [ tracks ] ) ;
4950
5051 return (
51- < div ref = { innerScrollableRef } className = { styles . trackListScroller } >
52+ < Scrollable ref = { innerScrollableRef } >
5253 { trackGroups . map ( ( tracksGroup ) => {
5354 return (
5455 < TrackListGroup
@@ -60,7 +61,7 @@ export default function TrackListGroupedLayout(props: Props) {
6061 />
6162 ) ;
6263 } ) }
63- </ div >
64+ </ Scrollable >
6465 ) ;
6566}
6667
@@ -87,23 +88,23 @@ function TrackListGroup(props: TrackListGroupProps) {
8788 }
8889
8990 return (
90- < div className = { styles . tracksGroup } >
91- < div className = { styles . tracksGroupSide } >
91+ < div className = { styles . group } >
92+ < aside className = { styles . aside } >
9293 { /** Instead of the first one, maybe get the first track within the album to hold a cover? */ }
9394 < Cover track = { tracks [ 0 ] } iconSize = { 36 } noBorder />
94- < h3 className = { styles . tracksGroupLabel } > { label } </ h3 >
95- < div className = { styles . tracksGroupMetadata } >
95+ < h3 className = { styles . label } > { label } </ h3 >
96+ < div className = { styles . metadata } >
9697 < div >
97- { year ? < span > { year } - </ span > : null }
98- { genres . join ( ', ' ) }
98+ { year }
99+ { genres . length > 0 && < span > - { genres . join ( ', ' ) } </ span > }
99100 </ div >
100101 < div >
101102 < Plural value = { tracks . length } one = "# track" other = "# tracks" /> ,{ ' ' }
102103 { parseDuration ( duration ) }
103104 </ div >
104105 </ div >
105- </ div >
106- < div className = { styles . tracksGroupContent } >
106+ </ aside >
107+ < div className = { styles . rows } >
107108 { tracks . map ( ( track , index ) => {
108109 return (
109110 < TrackRow
0 commit comments