@@ -11,20 +11,19 @@ import {
11
11
import { goBack } from "app/system/navigation/navigate"
12
12
import { extractNodes } from "app/utils/extractNodes"
13
13
import { useFeatureFlag } from "app/utils/hooks/useFeatureFlag"
14
- import { useLocation } from "app/utils/hooks/useLocation"
14
+ import { Location , useLocation } from "app/utils/hooks/useLocation"
15
15
import { ProvideScreenTrackingWithCohesionSchema } from "app/utils/track"
16
16
import { screen } from "app/utils/track/helpers"
17
17
import { Suspense , useState } from "react"
18
18
import { ActivityIndicator , RefreshControl } from "react-native"
19
19
import { graphql , useLazyLoadQuery , usePaginationFragment } from "react-relay"
20
20
21
- const ShowsForYou : React . FC = ( ) => {
22
- const enableShowsForYouLocation = useFeatureFlag ( "AREnableShowsForYouLocation" )
21
+ interface ShowsForYouProps {
22
+ location : Location | null
23
+ }
23
24
24
- const { location, isLoading } = useLocation ( {
25
- disabled : ! enableShowsForYouLocation ,
26
- skipPermissionRequests : true ,
27
- } )
25
+ const ShowsForYou : React . FC < ShowsForYouProps > = ( { location } ) => {
26
+ const enableShowsForYouLocation = useFeatureFlag ( "AREnableShowsForYouLocation" )
28
27
29
28
const showsForYouQueryVariables = location
30
29
? { near : location , count : 10 }
@@ -35,10 +34,6 @@ const ShowsForYou: React.FC = () => {
35
34
showsForYouQueryVariables
36
35
)
37
36
38
- if ( isLoading ) {
39
- return < ArticlesPlaceholder title = "Shows for You" />
40
- }
41
-
42
37
return < ShowsForYouList me = { queryData . me } />
43
38
}
44
39
@@ -117,9 +112,20 @@ export const ShowsForYouList: React.FC<{ me: any }> = ({ me }) => {
117
112
}
118
113
119
114
export const ShowsForYouScreen : React . FC = ( ) => {
115
+ const enableShowsForYouLocation = useFeatureFlag ( "AREnableShowsForYouLocation" )
116
+
117
+ const { location, isLoading } = useLocation ( {
118
+ disabled : ! enableShowsForYouLocation ,
119
+ skipPermissionRequests : true ,
120
+ } )
121
+
122
+ if ( isLoading ) {
123
+ return < ArticlesPlaceholder title = "Shows for You" />
124
+ }
125
+
120
126
return (
121
127
< Suspense fallback = { < ArticlesPlaceholder title = "Shows for You" /> } >
122
- < ShowsForYou />
128
+ < ShowsForYou location = { location } />
123
129
</ Suspense >
124
130
)
125
131
}
0 commit comments