@@ -3,9 +3,10 @@ import { trackPageMessages as messages } from '@audius/common/messages'
33import type { ID , User } from '@audius/common/models'
44import { tracksActions } from '~/store/pages/track/lineup/actions'
55
6- import { Button , Flex , Text } from '@audius/harmony-native'
6+ import { Flex , Text } from '@audius/harmony-native'
77import { TanQueryLineup } from 'app/components/lineup/TanQueryLineup'
8- import { useNavigation } from 'app/hooks/useNavigation'
8+
9+ import { ViewOtherRemixesButton } from './ViewOtherRemixesButton'
910
1011type TrackScreenLineupProps = {
1112 user : User | null
@@ -46,25 +47,13 @@ export const TrackScreenLineup = ({
4647 data
4748 } = useTrackPageLineup ( { trackId } )
4849
49- const navigation = useNavigation ( )
50-
51- const viewRemixesButton = (
52- < Button
53- style = { { alignSelf : 'flex-start' } }
54- size = 'small'
55- onPress = { ( ) => {
56- navigation . navigate ( 'TrackRemixes' , { trackId } )
57- } }
58- >
59- { messages . viewOtherRemixes }
60- </ Button >
61- )
62-
6350 if ( ! indices ) return null
6451
6552 const renderRemixParentSection = ( ) => {
6653 if ( indices . remixParentSection . index === undefined ) return null
6754
55+ const parentTrackId = data ?. [ indices . remixParentSection . index ] ?. id
56+
6857 return (
6958 < Section title = { messages . originalTrack } >
7059 < Flex column gap = 'l' >
@@ -73,6 +62,7 @@ export const TrackScreenLineup = ({
7362 lineup = { lineup }
7463 offset = { indices . remixParentSection . index }
7564 maxEntries = { indices . remixParentSection . pageSize }
65+ pageSize = { pageSize }
7666 includeLineupStatus
7767 itemStyles = { itemStyles }
7868 isFetching = { isFetching }
@@ -81,14 +71,16 @@ export const TrackScreenLineup = ({
8171 isPending = { isPending }
8272 queryData = { data }
8373 />
84- { viewRemixesButton }
74+ { parentTrackId ? (
75+ < ViewOtherRemixesButton parentTrackId = { parentTrackId } />
76+ ) : null }
8577 </ Flex >
8678 </ Section >
8779 )
8880 }
8981
9082 const renderRemixesSection = ( ) => {
91- if ( indices . remixesSection . index === null ) return null
83+ if ( indices . remixesSection . index === undefined ) return null
9284
9385 return (
9486 < Section title = { messages . remixes } >
@@ -98,6 +90,7 @@ export const TrackScreenLineup = ({
9890 lineup = { lineup }
9991 offset = { indices . remixesSection . index }
10092 maxEntries = { indices . remixesSection . pageSize }
93+ pageSize = { pageSize }
10194 includeLineupStatus
10295 itemStyles = { itemStyles }
10396 isFetching = { isFetching }
@@ -106,7 +99,7 @@ export const TrackScreenLineup = ({
10699 isPending = { isPending }
107100 queryData = { data }
108101 />
109- { viewRemixesButton }
102+ < ViewOtherRemixesButton parentTrackId = { trackId } />
110103 </ Flex >
111104 </ Section >
112105 )
@@ -122,6 +115,7 @@ export const TrackScreenLineup = ({
122115 lineup = { lineup }
123116 offset = { indices . moreBySection . index }
124117 maxEntries = { indices . moreBySection . pageSize ?? pageSize }
118+ pageSize = { pageSize }
125119 includeLineupStatus
126120 itemStyles = { itemStyles }
127121 isFetching = { isFetching }
@@ -144,6 +138,7 @@ export const TrackScreenLineup = ({
144138 lineup = { lineup }
145139 offset = { indices . recommendedSection . index }
146140 maxEntries = { indices . recommendedSection . pageSize }
141+ pageSize = { pageSize }
147142 includeLineupStatus
148143 itemStyles = { itemStyles }
149144 isFetching = { isFetching }
0 commit comments