diff --git a/src/screens/VideoFeed/index.tsx b/src/screens/VideoFeed/index.tsx index 8ea3e1c623..bacedb737c 100644 --- a/src/screens/VideoFeed/index.tsx +++ b/src/screens/VideoFeed/index.tsx @@ -33,6 +33,7 @@ import { AppBskyFeedPost, AtUri, type ModerationDecision, + type ModerationOpts, RichText as RichTextAPI, } from '@atproto/api' import {msg, Trans} from '@lingui/macro' @@ -54,7 +55,6 @@ import { type CommonNavigatorParams, type NavigationProp, } from '#/lib/routes/types' -import {sanitizeDisplayName} from '#/lib/strings/display-names' import {cleanError} from '#/lib/strings/errors' import {sanitizeHandle} from '#/lib/strings/handles' import {isAndroid} from '#/platform/detection' @@ -70,6 +70,7 @@ import { useFeedFeedbackContext, } from '#/state/feed-feedback' import {useFeedFeedback} from '#/state/feed-feedback' +import {useModerationOpts} from '#/state/preferences/moderation-opts' import {useFeedInfo} from '#/state/queries/feed' import {usePostLikeMutationQueue} from '#/state/queries/post' import { @@ -95,10 +96,10 @@ import {EyeSlash_Stroke2_Corner0_Rounded as Eye} from '#/components/icons/EyeSla import {Leaf_Stroke2_Corner0_Rounded as LeafIcon} from '#/components/icons/Leaf' import {KeepAwake} from '#/components/KeepAwake' import * as Layout from '#/components/Layout' -import {Link} from '#/components/Link' import {ListFooter} from '#/components/Lists' import * as Hider from '#/components/moderation/Hider' import {PostControls} from '#/components/PostControls' +import * as ProfileCard from '#/components/ProfileCard' import {RichText} from '#/components/RichText' import {Text} from '#/components/Typography' import * as bsky from '#/types/bsky' @@ -189,6 +190,7 @@ function Feed() { const isFocused = useIsFocused() const {hasSession} = useSession() const {height} = useSafeAreaFrame() + const moderationOpts = useModerationOpts() const feedDesc = useMemo(() => { switch (params.type) { @@ -280,13 +282,21 @@ function Feed() { } adjacent={index === currentIndex - 1 || index === currentIndex + 1} moderation={item.moderation} + moderationOpts={moderationOpts} scrollGesture={scrollGesture} feedContext={item.feedContext} reqId={item.reqId} /> ) }, - [players, currentIndex, isFocused, currentSources, scrollGesture], + [ + players, + currentIndex, + isFocused, + currentSources, + scrollGesture, + moderationOpts, + ], ) const updateVideoState = useCallback( @@ -478,6 +488,7 @@ let VideoItem = ({ adjacent, scrollGesture, moderation, + moderationOpts, feedContext, reqId, }: { @@ -488,6 +499,7 @@ let VideoItem = ({ adjacent: boolean scrollGesture: NativeGesture moderation?: ModerationDecision + moderationOpts?: ModerationOpts feedContext: string | undefined reqId: string | undefined }): React.ReactNode => { @@ -548,6 +560,7 @@ let VideoItem = ({ active={active} scrollGesture={scrollGesture} moderation={moderation} + moderationOpts={moderationOpts} feedContext={feedContext} reqId={reqId} /> @@ -694,6 +707,7 @@ function Overlay({ active, scrollGesture, moderation, + moderationOpts, feedContext, reqId, }: { @@ -703,11 +717,11 @@ function Overlay({ active: boolean scrollGesture: NativeGesture moderation: ModerationDecision + moderationOpts?: ModerationOpts feedContext: string | undefined reqId: string | undefined }) { const {_} = useLingui() - const t = useTheme() const {openComposer} = useOpenComposer() const {currentAccount} = useSession() const navigation = useNavigation() @@ -790,75 +804,57 @@ function Overlay({ ]} style={[a.w_full, a.pt_md]}> - - - - - - {sanitizeDisplayName( - post.author.displayName || post.author.handle, - )} - - - {handle} - - - - {/* show button based on non-reactive version, so it doesn't hide on press */} - {post.author.did !== currentAccount?.did && - !post.author.viewer?.following && ( - - )} - + + {profile.viewer?.following ? ( + Following + ) : ( + Follow + )} + + + )} + + )} {record?.text?.trim() && (