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('Read more on Last.fm</a>', '')}
placement="bottomStart"
disabled={!data?.info.biography}
>
<PageHeaderSubtitleDataLine
style={{

2
src/components/playlist/PlaylistView.tsx

@ -521,7 +521,7 @@ const PlaylistView = ({ ...rest }) => {
{data.created && `Created ${formatDate(data.created)}`}
{data.changed && ` • Modified ${formatDateTime(data.changed)}`}
</PageHeaderSubtitleDataLine>
<CustomTooltip text={data.comment}>
<CustomTooltip text={data.comment} placement="bottomStart" disabled={!data.comment}>
<PageHeaderSubtitleDataLine
style={{
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>;
const CustomTooltip = ({ children, text, delay, placement, ...rest }: any) => {
const CustomTooltip = ({ children, text, delay, placement, disabled, ...rest }: any) => {
return (
<Whisper
trigger="hover"
trigger={disabled ? 'none' : 'hover'}
delay={delay || 250}
speaker={tooltip(text)}
placement={placement || 'top'}

Loading…
Cancel
Save