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 isFocused = classList.contains('focused');
|
||||||
const isPlaying = classList.contains('playing');
|
const isPlaying = classList.contains('playing');
|
||||||
const isCurrentSong =
|
const isCurrentSong =
|
||||||
classList.contains('current-song') || classList.contains('current-playlist-song');
|
classList.contains('current-song-cell') || classList.contains('current-playlist-song-cell');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CellContainer $position="right">
|
<CellContainer $position="right">
|
||||||
|
|
|
@ -266,21 +266,7 @@ const tableColumns: { [key: string]: ColDef } = {
|
||||||
},
|
},
|
||||||
rowIndex: {
|
rowIndex: {
|
||||||
cellClass: 'row-index',
|
cellClass: 'row-index',
|
||||||
cellClassRules: {
|
cellRenderer: (params: ICellRendererParams) => GenericCell(params, { position: 'right' }),
|
||||||
'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,
|
|
||||||
colId: TableColumn.ROW_INDEX,
|
colId: TableColumn.ROW_INDEX,
|
||||||
headerComponent: (params: IHeaderParams) =>
|
headerComponent: (params: IHeaderParams) =>
|
||||||
GenericTableHeader(params, { position: 'right', preset: 'rowIndex' }),
|
GenericTableHeader(params, { position: 'right', preset: 'rowIndex' }),
|
||||||
|
@ -293,7 +279,10 @@ const tableColumns: { [key: string]: ColDef } = {
|
||||||
rowIndexGeneric: {
|
rowIndexGeneric: {
|
||||||
cellClass: 'row-index',
|
cellClass: 'row-index',
|
||||||
cellClassRules: {
|
cellClassRules: {
|
||||||
'current-song': (params) => {
|
'current-playlist-song-cell': (params) => {
|
||||||
|
return params.data?.uniqueId === params.context?.currentSong?.uniqueId;
|
||||||
|
},
|
||||||
|
'current-song-cell': (params) => {
|
||||||
return (
|
return (
|
||||||
params.data?.id === params.context?.currentSong?.id &&
|
params.data?.id === params.context?.currentSong?.id &&
|
||||||
params.data?.albumId === params.context?.currentSong?.albumId
|
params.data?.albumId === params.context?.currentSong?.albumId
|
||||||
|
@ -372,7 +361,7 @@ const tableColumns: { [key: string]: ColDef } = {
|
||||||
trackNumberDetail: {
|
trackNumberDetail: {
|
||||||
cellClass: 'row-index',
|
cellClass: 'row-index',
|
||||||
cellClassRules: {
|
cellClassRules: {
|
||||||
'current-song': (params) => {
|
'current-song-cell': (params) => {
|
||||||
return (
|
return (
|
||||||
params.data?.id === params.context?.currentSong?.id &&
|
params.data?.id === params.context?.currentSong?.id &&
|
||||||
params.data?.albumId === params.context?.currentSong?.albumId
|
params.data?.albumId === params.context?.currentSong?.albumId
|
||||||
|
|
Reference in a new issue