diff --git a/packages/web/src/components/collection/desktop/OwnerActionButtons.tsx b/packages/web/src/components/collection/desktop/OwnerActionButtons.tsx index 6914a00d55..92fb7bd514 100644 --- a/packages/web/src/components/collection/desktop/OwnerActionButtons.tsx +++ b/packages/web/src/components/collection/desktop/OwnerActionButtons.tsx @@ -23,6 +23,8 @@ export const OwnerActionButtons = (props: OwnerActionButtonProps) => { ) as Collection const { track_count, is_private, is_album } = collection ?? {} + const isDisabled = track_count === 0 + return collection ? ( <> { /> {is_private && !is_album ? ( diff --git a/packages/web/src/components/collection/desktop/ShareButton.tsx b/packages/web/src/components/collection/desktop/ShareButton.tsx index a1c6679d0a..aada3e2b17 100644 --- a/packages/web/src/components/collection/desktop/ShareButton.tsx +++ b/packages/web/src/components/collection/desktop/ShareButton.tsx @@ -16,17 +16,17 @@ import { EntityActionButton } from '../../entity-page/EntityActionButton' const { requestOpen: requestOpenShareModal } = shareModalUIActions const messages = { - share: 'Share', - emptyPlaylistTooltipText: 'You can’t share an empty playlist.' + share: 'Share' } type ShareButtonProps = Partial & { collectionId: SmartCollectionVariant | ID userId?: ID + tooltipText?: string } export const ShareButton = (props: ShareButtonProps) => { - const { collectionId, type, userId, ...other } = props + const { collectionId, type, userId, tooltipText, ...other } = props const dispatch = useDispatch() const handleShare = useCallback(() => { @@ -64,8 +64,8 @@ export const ShareButton = (props: ShareButtonProps) => { /> ) - return other.disabled ? ( - + return tooltipText ? ( + {shareButtonElement} ) : ( diff --git a/packages/web/src/components/collection/desktop/ViewerActionButtons.tsx b/packages/web/src/components/collection/desktop/ViewerActionButtons.tsx index f1e4f25494..609d2281d7 100644 --- a/packages/web/src/components/collection/desktop/ViewerActionButtons.tsx +++ b/packages/web/src/components/collection/desktop/ViewerActionButtons.tsx @@ -4,7 +4,6 @@ import { CommonState, ID } from '@audius/common' -import { ButtonType } from '@audius/stems' import { useSelector } from 'react-redux' import { FavoriteButton } from './FavoriteButton' @@ -24,23 +23,24 @@ export const ViewerActionButtons = (props: ViewerActionButtonsProps) => { getCollection(state, { id: collectionId }) ) as Collection | null - const isEmptyPlaylist = !collection || collection.track_count === 0 + const { track_count, is_private } = collection ?? {} + const isDisabled = !collection || track_count === 0 || is_private return ( <>