Browse Source

Fix album page genre keys

Fix keys for genre/artist columns

Fix keys for the album view genre list

Additional fix to genre/artist keys
master
jeffvli 3 years ago
parent
commit
e9e5459015
  1. 5
      src/components/library/AlbumView.tsx
  2. 31
      src/components/viewtypes/ListViewTable.tsx

5
src/components/library/AlbumView.tsx

@ -366,12 +366,11 @@ const AlbumView = ({ ...rest }: any) => {
Added {formatDate(data.created)} Added {formatDate(data.created)}
{data.genre.map((d: Genre, i: number) => { {data.genre.map((d: Genre, i: number) => {
return ( return (
<> <span key={nanoid()}>
{i === 0 && ' • '} {i === 0 && ' • '}
{i > 0 && ', '} {i > 0 && ', '}
<LinkWrapper maxWidth="13vw"> <LinkWrapper maxWidth="13vw">
<StyledLink <StyledLink
key={nanoid()}
tabIndex={0} tabIndex={0}
onClick={() => { onClick={() => {
if (!rest.isModal) { if (!rest.isModal) {
@ -396,7 +395,7 @@ const AlbumView = ({ ...rest }: any) => {
{d.title} {d.title}
</StyledLink> </StyledLink>
</LinkWrapper> </LinkWrapper>
</> </span>
); );
})} })}
</PageHeaderSubtitleDataLine> </PageHeaderSubtitleDataLine>

31
src/components/viewtypes/ListViewTable.tsx

@ -746,7 +746,7 @@ const ListViewTable = ({
}} }}
> >
{(rowData.artist || []).map((artist: GenericItem, i: number) => ( {(rowData.artist || []).map((artist: GenericItem, i: number) => (
<> <span key={`${rowData.uniqueId}-${artist.id}`}>
<SecondaryTextWrapper <SecondaryTextWrapper
key={nanoid()} key={nanoid()}
playing={ playing={
@ -762,7 +762,10 @@ const ListViewTable = ({
> >
{i > 0 && ', '} {i > 0 && ', '}
</SecondaryTextWrapper> </SecondaryTextWrapper>
<CustomTooltip key={artist.id} text={artist.title}> <CustomTooltip
key={`artist-${rowData.uniqueId}-${artist.id}`}
text={artist.title}
>
<RsuiteLinkButton <RsuiteLinkButton
subtitle="true" subtitle="true"
appearance="link" appearance="link"
@ -796,7 +799,7 @@ const ListViewTable = ({
{artist.title} {artist.title}
</RsuiteLinkButton> </RsuiteLinkButton>
</CustomTooltip> </CustomTooltip>
</> </span>
))} ))}
</span> </span>
</Row> </Row>
@ -923,13 +926,9 @@ const ListViewTable = ({
<> <>
{rowData.genre ? ( {rowData.genre ? (
rowData.genre.map((genre: GenericItem, i: number) => ( rowData.genre.map((genre: GenericItem, i: number) => (
<> <span key={`${rowData.uniqueId}-${genre.id}`}>
{i > 0 && <span key={nanoid()}>, </span>} {i > 0 && ', '}
<CustomTooltip text={genre.title}>
<CustomTooltip
key={genre.id}
text={rowData[column.dataKey][i]?.title}
>
<RsuiteLinkButton <RsuiteLinkButton
appearance="link" appearance="link"
onClick={(e: any) => { onClick={(e: any) => {
@ -937,15 +936,11 @@ const ListViewTable = ({
dispatch( dispatch(
setActive({ setActive({
...album.active, ...album.active,
filter: rowData[column.dataKey][i]?.title, filter: genre.title,
}) })
); );
setTimeout(() => { setTimeout(() => {
history.push( history.push(`/library/album?sortType=${genre.title}`);
`/library/album?sortType=${
rowData[column.dataKey][i]?.title
}`
);
}, 50); }, 50);
} }
}} }}
@ -962,10 +957,10 @@ const ListViewTable = ({
fontSize: `${fontSize}px`, fontSize: `${fontSize}px`,
}} }}
> >
{rowData[column.dataKey][i]?.title} {genre.title}
</RsuiteLinkButton> </RsuiteLinkButton>
</CustomTooltip> </CustomTooltip>
</> </span>
)) ))
) : ( ) : (
<span>&#8203;</span> <span>&#8203;</span>

Loading…
Cancel
Save