Fix double border due to progress guide
This commit is contained in:
@@ -6,7 +6,6 @@ import {msg, Trans} from '@lingui/macro'
|
|||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
|
|
||||||
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
|
||||||
import {NavigationProp} from '#/lib/routes/types'
|
import {NavigationProp} from '#/lib/routes/types'
|
||||||
import {logEvent} from '#/lib/statsig/statsig'
|
import {logEvent} from '#/lib/statsig/statsig'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
@@ -16,7 +15,6 @@ import {FeedDescriptor} from '#/state/queries/post-feed'
|
|||||||
import {useProfilesQuery} from '#/state/queries/profile'
|
import {useProfilesQuery} from '#/state/queries/profile'
|
||||||
import {useSuggestedFollowsByActorQuery} from '#/state/queries/suggested-follows'
|
import {useSuggestedFollowsByActorQuery} from '#/state/queries/suggested-follows'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
import {useProgressGuide} from '#/state/shell/progress-guide'
|
|
||||||
import * as userActionHistory from '#/state/userActionHistory'
|
import * as userActionHistory from '#/state/userActionHistory'
|
||||||
import {SeenPost} from '#/state/userActionHistory'
|
import {SeenPost} from '#/state/userActionHistory'
|
||||||
import {atoms as a, useBreakpoints, useTheme, ViewStyleProp, web} from '#/alf'
|
import {atoms as a, useBreakpoints, useTheme, ViewStyleProp, web} from '#/alf'
|
||||||
@@ -506,23 +504,9 @@ export function SuggestedFeeds() {
|
|||||||
|
|
||||||
export function ProgressGuide() {
|
export function ProgressGuide() {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {isDesktop} = useWebMediaQueries()
|
return (
|
||||||
const guide = useProgressGuide('like-10-and-follow-7')
|
<View style={[t.atoms.border_contrast_low, a.px_lg, a.py_lg, a.pb_lg]}>
|
||||||
|
|
||||||
if (isDesktop) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
return guide ? (
|
|
||||||
<View
|
|
||||||
style={[
|
|
||||||
a.border_t,
|
|
||||||
t.atoms.border_contrast_low,
|
|
||||||
a.px_lg,
|
|
||||||
a.py_lg,
|
|
||||||
a.pb_lg,
|
|
||||||
]}>
|
|
||||||
<ProgressGuideList />
|
<ProgressGuideList />
|
||||||
</View>
|
</View>
|
||||||
) : null
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {useQueryClient} from '@tanstack/react-query'
|
|||||||
|
|
||||||
import {DISCOVER_FEED_URI, KNOWN_SHUTDOWN_FEEDS} from '#/lib/constants'
|
import {DISCOVER_FEED_URI, KNOWN_SHUTDOWN_FEEDS} from '#/lib/constants'
|
||||||
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
||||||
|
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
||||||
import {logEvent} from '#/lib/statsig/statsig'
|
import {logEvent} from '#/lib/statsig/statsig'
|
||||||
import {useTheme} from '#/lib/ThemeContext'
|
import {useTheme} from '#/lib/ThemeContext'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
@@ -32,6 +33,7 @@ import {
|
|||||||
usePostFeedQuery,
|
usePostFeedQuery,
|
||||||
} from '#/state/queries/post-feed'
|
} from '#/state/queries/post-feed'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
|
import {useProgressGuide} from '#/state/shell/progress-guide'
|
||||||
import {ProgressGuide, SuggestedFollows} from '#/components/FeedInterstitials'
|
import {ProgressGuide, SuggestedFollows} from '#/components/FeedInterstitials'
|
||||||
import {List, ListRef} from '../util/List'
|
import {List, ListRef} from '../util/List'
|
||||||
import {PostFeedLoadingPlaceholder} from '../util/LoadingPlaceholder'
|
import {PostFeedLoadingPlaceholder} from '../util/LoadingPlaceholder'
|
||||||
@@ -252,6 +254,10 @@ let PostFeed = ({
|
|||||||
}
|
}
|
||||||
}, [pollInterval])
|
}, [pollInterval])
|
||||||
|
|
||||||
|
const progressGuide = useProgressGuide('like-10-and-follow-7')
|
||||||
|
const {isDesktop} = useWebMediaQueries()
|
||||||
|
const showProgressIntersitial = progressGuide && !isDesktop
|
||||||
|
|
||||||
const feedItems: FeedRow[] = React.useMemo(() => {
|
const feedItems: FeedRow[] = React.useMemo(() => {
|
||||||
let feedKind: 'following' | 'discover' | 'profile' | undefined
|
let feedKind: 'following' | 'discover' | 'profile' | undefined
|
||||||
if (feedType === 'following') {
|
if (feedType === 'following') {
|
||||||
@@ -292,7 +298,7 @@ let PostFeed = ({
|
|||||||
|
|
||||||
if (hasSession) {
|
if (hasSession) {
|
||||||
if (feedKind === 'discover') {
|
if (feedKind === 'discover') {
|
||||||
if (sliceIndex === 0) {
|
if (sliceIndex === 0 && showProgressIntersitial) {
|
||||||
arr.push({
|
arr.push({
|
||||||
type: 'interstitialProgressGuide',
|
type: 'interstitialProgressGuide',
|
||||||
key: 'interstitial-' + sliceIndex + '-' + lastFetchedAt,
|
key: 'interstitial-' + sliceIndex + '-' + lastFetchedAt,
|
||||||
@@ -382,6 +388,7 @@ let PostFeed = ({
|
|||||||
feedUri,
|
feedUri,
|
||||||
feedTab,
|
feedTab,
|
||||||
hasSession,
|
hasSession,
|
||||||
|
showProgressIntersitial,
|
||||||
])
|
])
|
||||||
|
|
||||||
// events
|
// events
|
||||||
|
|||||||
Reference in New Issue
Block a user