Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C-4019] Fix web track menu options #7934

Merged
merged 2 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions packages/web/src/components/track/GiantTrackTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export type GiantTrackTileProps = {
currentUserId: Nullable<ID>
description: string
hasStreamAccess: boolean
hasDownloadAccess: boolean
duration: number
fieldVisibility: FieldVisibility
following: boolean
Expand All @@ -128,17 +127,6 @@ export type GiantTrackTileProps = {
mood: string
onClickFavorites: () => void
onClickReposts: () => void
onDownload: ({
trackId,
category,
original,
parentTrackId
}: {
trackId: ID
category?: string
original?: boolean
parentTrackId?: ID
}) => void
onMakePublic: (trackId: ID) => void
onFollow: () => void
onPlay: () => void
Expand Down Expand Up @@ -169,7 +157,6 @@ export const GiantTrackTile = ({
credits,
description,
hasStreamAccess,
hasDownloadAccess,
duration,
fieldVisibility,
following,
Expand All @@ -188,7 +175,6 @@ export const GiantTrackTile = ({
mood,
onClickFavorites,
onClickReposts,
onDownload,
onFollow,
onMakePublic,
onPlay,
Expand Down Expand Up @@ -528,9 +514,10 @@ export const GiantTrackTile = ({
includeFavorite: false,
includeTrackPage: false,
isArtistPick,
includeEmbed: !(isUnlisted || isStreamGated),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want this change because it's your own private track or link was shared with you and if you see the menu you already have access, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we want this change for embed then i should update the other track-menu on track-tile cause it has the "embed" option. so are you saying if a track is private you shouldn't have embed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah just checked and it results in an error, so ill update the track-tile one to not include it, great catch!

includeEmbed: !isStreamGated,
includeArtistPick: !isUnlisted,
includeAddToPlaylist: !(isUnlisted || isStreamGated),
includeAddToPlaylist: !isStreamGated,
includeAddToAlbum: !isStreamGated,
extraMenuItems: overflowMenuExtraItems
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ const ConnectedTrackTile = ({
extraMenuItems: [],
handle,
includeAddToPlaylist: !isStreamGated,
includeAddToAlbum: !isStreamGated,
includeArtistPick: handle === userHandle && !isUnlisted,
includeEdit: handle === userHandle,
includeEmbed: !isStreamGated,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,6 @@ export type OwnProps = {

onSaveTrack: (isSaved: boolean, trackId: ID) => void
makePublic: (trackId: ID) => void
onDownloadTrack: ({
trackId,
category,
parentTrackId
}: {
trackId: ID
category?: string
parentTrackId?: ID
}) => void
// Tracks Lineup Props
tracks: LineupState<Track>
currentQueueItem: QueueItem
Expand Down Expand Up @@ -95,7 +86,6 @@ const TrackPage = ({
onSaveTrack,
onFollow,
onUnfollow,
onDownloadTrack,
makePublic,
onClickReposts,
onClickFavorites,
Expand All @@ -114,7 +104,7 @@ const TrackPage = ({
const isSaved = heroTrack?.has_current_user_saved ?? false
const isReposted = heroTrack?.has_current_user_reposted ?? false

const { isFetchingNFTAccess, hasStreamAccess, hasDownloadAccess } =
const { isFetchingNFTAccess, hasStreamAccess } =
useGatedContentAccess(heroTrack)
const loading = !heroTrack || isFetchingNFTAccess

Expand Down Expand Up @@ -169,7 +159,6 @@ const TrackPage = ({
isDownloadGated={defaults.isDownloadGated}
downloadConditions={defaults.downloadConditions}
hasStreamAccess={hasStreamAccess}
hasDownloadAccess={hasDownloadAccess}
isRemix={!!defaults.remixParentTrackId}
isPublishing={defaults.isPublishing}
fieldVisibility={defaults.fieldVisibility}
Expand All @@ -183,7 +172,6 @@ const TrackPage = ({
following={following}
onFollow={onFollow}
onUnfollow={onUnfollow}
onDownload={onDownloadTrack}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is download track already an action button on track page?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this was all greyed out because unused

onMakePublic={makePublic}
onClickReposts={onClickReposts}
onClickFavorites={onClickFavorites}
Expand Down