diff options
Diffstat (limited to 'src/view/com/posts/Feed.tsx')
-rw-r--r-- | src/view/com/posts/Feed.tsx | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/src/view/com/posts/Feed.tsx b/src/view/com/posts/Feed.tsx index f0709a3ea..bad6ccfea 100644 --- a/src/view/com/posts/Feed.tsx +++ b/src/view/com/posts/Feed.tsx @@ -101,7 +101,7 @@ const feedInterstitialType = 'interstitialFeeds' const followInterstitialType = 'interstitialFollows' const progressGuideInterstitialType = 'interstitialProgressGuide' const interstials: Record< - 'following' | 'discover', + 'following' | 'discover' | 'profile', (FeedItem & { type: | 'interstitialFeeds' @@ -128,6 +128,16 @@ const interstials: Record< slot: 20, }, ], + profile: [ + { + type: followInterstitialType, + params: { + variant: 'default', + }, + key: followInterstitialType, + slot: 5, + }, + ], } export function getFeedPostSlice(feedItem: FeedItem): FeedPostSlice | null { @@ -193,9 +203,7 @@ let Feed = ({ const [isPTRing, setIsPTRing] = React.useState(false) const checkForNewRef = React.useRef<(() => void) | null>(null) const lastFetchRef = React.useRef<number>(Date.now()) - const [feedType, feedUri] = feed.split('|') - const feedIsDiscover = feedUri === DISCOVER_FEED_URI - const feedIsFollowing = feedType === 'following' + const [feedType, feedUri, feedTab] = feed.split('|') const gate = useGate() const opts = React.useMemo( @@ -339,14 +347,21 @@ let Feed = ({ } if (hasSession) { - const feedType = feedIsFollowing - ? 'following' - : feedIsDiscover - ? 'discover' - : undefined + let feedKind: 'following' | 'discover' | 'profile' | undefined + if (feedType === 'following') { + feedKind = 'following' + } else if (feedUri === DISCOVER_FEED_URI) { + feedKind = 'discover' + } else if ( + feedType === 'author' && + (feedTab === 'posts_and_author_threads' || + feedTab === 'posts_with_replies') + ) { + feedKind = 'profile' + } - if (feedType) { - for (const interstitial of interstials[feedType]) { + if (feedKind) { + for (const interstitial of interstials[feedKind]) { const shouldShow = (interstitial.type === feedInterstitialType && gate('suggested_feeds_interstitial')) || @@ -377,9 +392,9 @@ let Feed = ({ isEmpty, lastFetchedAt, data, + feedType, feedUri, - feedIsDiscover, - feedIsFollowing, + feedTab, gate, hasSession, ]) @@ -470,7 +485,7 @@ let Feed = ({ } else if (item.type === feedInterstitialType) { return <SuggestedFeeds /> } else if (item.type === followInterstitialType) { - return <SuggestedFollows /> + return <SuggestedFollows feed={feed} /> } else if (item.type === progressGuideInterstitialType) { return <ProgressGuide /> } else if (item.type === 'slice') { |