Browse Source

Add tooltip disable

-Allow disabling album/playlist descriptions when null
master
jeffvli 3 years ago
committed by Jeff
parent
commit
510fade16a
  1. 1
      src/components/library/ArtistView.tsx
  2. 2
      src/components/playlist/PlaylistView.tsx
  3. 4
      src/components/shared/CustomTooltip.tsx

1
src/components/library/ArtistView.tsx

@ -374,6 +374,7 @@ const ArtistView = ({ ...rest }: any) => {
?.replace(/<[^>]*>/, '') ?.replace(/<[^>]*>/, '')
.replace('Read more on Last.fm</a>', '')} .replace('Read more on Last.fm</a>', '')}
placement="bottomStart" placement="bottomStart"
disabled={!data?.info.biography}
> >
<PageHeaderSubtitleDataLine <PageHeaderSubtitleDataLine
style={{ style={{

2
src/components/playlist/PlaylistView.tsx

@ -521,7 +521,7 @@ const PlaylistView = ({ ...rest }) => {
{data.created && `Created ${formatDate(data.created)}`} {data.created && `Created ${formatDate(data.created)}`}
{data.changed && ` • Modified ${formatDateTime(data.changed)}`} {data.changed && ` • Modified ${formatDateTime(data.changed)}`}
</PageHeaderSubtitleDataLine> </PageHeaderSubtitleDataLine>
<CustomTooltip text={data.comment}> <CustomTooltip text={data.comment} placement="bottomStart" disabled={!data.comment}>
<PageHeaderSubtitleDataLine <PageHeaderSubtitleDataLine
style={{ style={{
minHeight: '1.2rem', minHeight: '1.2rem',

4
src/components/shared/CustomTooltip.tsx

@ -13,10 +13,10 @@ const StyledTooltip = styled(Tooltip)`
export const tooltip = (text: string) => <StyledTooltip>{text}</StyledTooltip>; export const tooltip = (text: string) => <StyledTooltip>{text}</StyledTooltip>;
const CustomTooltip = ({ children, text, delay, placement, ...rest }: any) => { const CustomTooltip = ({ children, text, delay, placement, disabled, ...rest }: any) => {
return ( return (
<Whisper <Whisper
trigger="hover" trigger={disabled ? 'none' : 'hover'}
delay={delay || 250} delay={delay || 250}
speaker={tooltip(text)} speaker={tooltip(text)}
placement={placement || 'top'} placement={placement || 'top'}

Loading…
Cancel
Save