Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
[C-808] Don't show unnecessarily show profile option on overflow menu (
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjeffers committed Aug 11, 2022
1 parent 94e188f commit c2a79ff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 5 additions & 1 deletion packages/mobile/src/components/lineup-tile/TrackTile.tsx
Expand Up @@ -93,6 +93,10 @@ const TrackTileComponent = ({
track_id
} = track

const currentScreen = navigation.getState().history?.[0]
// @ts-expect-error -- history returning unknown[]
const isOnArtistsTracksTab = currentScreen?.key.includes('Tracks')

const { user_id } = user

const isOwner = user_id === currentUserId
Expand Down Expand Up @@ -141,7 +145,7 @@ const TrackTileComponent = ({
OverflowAction.SHARE,
OverflowAction.ADD_TO_PLAYLIST,
OverflowAction.VIEW_TRACK_PAGE,
OverflowAction.VIEW_ARTIST_PAGE
isOnArtistsTracksTab ? null : OverflowAction.VIEW_ARTIST_PAGE
].filter(Boolean) as OverflowAction[]

dispatchWeb(
Expand Down
3 changes: 1 addition & 2 deletions packages/mobile/src/components/track-list/TrackList.tsx
Expand Up @@ -86,7 +86,7 @@ export const TrackList = ({
)

const renderDraggableTrack: DraggableFlatListProps<TrackMetadata>['renderItem'] =
({ item: track, index = -1, drag, isActive: isDragActive }) => {
({ item: track, index = -1, drag }) => {
const isActive = track.uid !== undefined && track.uid === playingUid

// The dividers above and belove the active track should be hidden
Expand All @@ -108,7 +108,6 @@ export const TrackList = ({
drag={drag}
hideArt={hideArt}
isActive={isActive}
isDragging={isDragActive}
isPlaying={isPlaying}
isReorderable={isReorderable}
track={track}
Expand Down
4 changes: 0 additions & 4 deletions packages/mobile/src/components/track-list/TrackListItem.tsx
Expand Up @@ -89,10 +89,8 @@ export type TrackListItemProps = {
hideArt?: boolean
index: number
isActive?: boolean
isDragging?: boolean
isLoading?: boolean
isPlaying?: boolean
isRemoveActive?: boolean
isReorderable?: boolean
onRemove?: (index: number) => void
onSave?: (isSaved: boolean, trackId: ID) => void
Expand All @@ -106,8 +104,6 @@ export const TrackListItem = ({
hideArt,
index,
isActive,
isDragging = false,
isRemoveActive = false,
isReorderable = false,
isLoading = false,
isPlaying = false,
Expand Down
1 change: 1 addition & 0 deletions packages/mobile/src/hooks/useNavigation.ts
Expand Up @@ -57,6 +57,7 @@ export const useNavigation = <

return useMemo(
() => ({
...nativeNavigation,
navigate: performNavigation(nativeNavigation.navigate),
push:
'push' in nativeNavigation
Expand Down

0 comments on commit c2a79ff

Please sign in to comment.