Browse Source

Add tooltips to card overlay buttons

- Add to queue
- Favorite
- View in modal
master
jeffvli 3 years ago
committed by Jeff
parent
commit
c6a3d3ccce
  1. 11
      src/components/card/Card.tsx

11
src/components/card/Card.tsx

@ -148,29 +148,40 @@ const Card = ({
icon={<Icon icon="play" />} icon={<Icon icon="play" />}
onClick={handlePlayClick} onClick={handlePlayClick}
/> />
<CustomTooltip text="Add to queue (later)">
<AppendOverlayButton <AppendOverlayButton
onClick={() => handlePlayAppend('later')} onClick={() => handlePlayAppend('later')}
size={size <= 160 ? 'xs' : 'sm'} size={size <= 160 ? 'xs' : 'sm'}
icon={<Icon icon="plus" />} icon={<Icon icon="plus" />}
/> />
</CustomTooltip>
<CustomTooltip text="Add to queue (next)">
<AppendNextOverlayButton <AppendNextOverlayButton
onClick={() => handlePlayAppend('next')} onClick={() => handlePlayAppend('next')}
size={size <= 160 ? 'xs' : 'sm'} size={size <= 160 ? 'xs' : 'sm'}
icon={<Icon icon="plus-circle" />} icon={<Icon icon="plus-circle" />}
/> />
</CustomTooltip>
{playClick.type !== 'playlist' && ( {playClick.type !== 'playlist' && (
<CustomTooltip text="Toggle favorite">
<FavoriteOverlayButton <FavoriteOverlayButton
onClick={() => handleFavorite(rest.details)} onClick={() => handleFavorite(rest.details)}
size={size <= 160 ? 'xs' : 'sm'} size={size <= 160 ? 'xs' : 'sm'}
icon={<Icon icon={rest.details.starred ? 'heart' : 'heart-o'} />} icon={<Icon icon={rest.details.starred ? 'heart' : 'heart-o'} />}
/> />
</CustomTooltip>
)} )}
{!rest.isModal && ( {!rest.isModal && (
<CustomTooltip text="View in modal">
<ModalViewOverlayButton <ModalViewOverlayButton
size={size <= 160 ? 'xs' : 'sm'} size={size <= 160 ? 'xs' : 'sm'}
icon={<Icon icon="external-link" />} icon={<Icon icon="external-link" />}
onClick={handleOpenModal} onClick={handleOpenModal}
/> />
</CustomTooltip>
)} )}
</> </>
)} )}

Loading…
Cancel
Save