Fix className clash on current song
This commit is contained in:
parent
e77efcf836
commit
8e2a107d4a
2 changed files with 7 additions and 18 deletions
|
@ -137,7 +137,7 @@ export const RowIndexCell = ({ value, eGridCell }: ICellRendererParams) => {
|
|||
const isFocused = classList.contains('focused');
|
||||
const isPlaying = classList.contains('playing');
|
||||
const isCurrentSong =
|
||||
classList.contains('current-song') || classList.contains('current-playlist-song');
|
||||
classList.contains('current-song-cell') || classList.contains('current-playlist-song-cell');
|
||||
|
||||
return (
|
||||
<CellContainer $position="right">
|
||||
|
|
|
@ -266,21 +266,7 @@ const tableColumns: { [key: string]: ColDef } = {
|
|||
},
|
||||
rowIndex: {
|
||||
cellClass: 'row-index',
|
||||
cellClassRules: {
|
||||
'current-playlist-song': (params) => {
|
||||
return params.data?.uniqueId === params.context?.currentSong?.uniqueId;
|
||||
},
|
||||
'current-song': (params) => {
|
||||
return params.data?.uniqueId === params.context?.currentSong?.uniqueId;
|
||||
},
|
||||
focused: (params) => {
|
||||
return params.context?.isFocused;
|
||||
},
|
||||
playing: (params) => {
|
||||
return params.context?.status === PlayerStatus.PLAYING;
|
||||
},
|
||||
},
|
||||
cellRenderer: RowIndexCell,
|
||||
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'right' }),
|
||||
colId: TableColumn.ROW_INDEX,
|
||||
headerComponent: (params: IHeaderParams) =>
|
||||
GenericTableHeader(params, { position: 'right', preset: 'rowIndex' }),
|
||||
|
@ -293,7 +279,10 @@ const tableColumns: { [key: string]: ColDef } = {
|
|||
rowIndexGeneric: {
|
||||
cellClass: 'row-index',
|
||||
cellClassRules: {
|
||||
'current-song': (params) => {
|
||||
'current-playlist-song-cell': (params) => {
|
||||
return params.data?.uniqueId === params.context?.currentSong?.uniqueId;
|
||||
},
|
||||
'current-song-cell': (params) => {
|
||||
return (
|
||||
params.data?.id === params.context?.currentSong?.id &&
|
||||
params.data?.albumId === params.context?.currentSong?.albumId
|
||||
|
@ -372,7 +361,7 @@ const tableColumns: { [key: string]: ColDef } = {
|
|||
trackNumberDetail: {
|
||||
cellClass: 'row-index',
|
||||
cellClassRules: {
|
||||
'current-song': (params) => {
|
||||
'current-song-cell': (params) => {
|
||||
return (
|
||||
params.data?.id === params.context?.currentSong?.id &&
|
||||
params.data?.albumId === params.context?.currentSong?.albumId
|
||||
|
|
Reference in a new issue