import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types' import { usePreferencesQuery, useSetFeedViewPreferencesMutation, } from '#/state/queries/preferences' import {atoms as a} from '#/alf' import {Admonition} from '#/components/Admonition' import * as Toggle from '#/components/forms/Toggle' import {Beaker_Stroke2_Corner2_Rounded as BeakerIcon} from '#/components/icons/Beaker' import {Bubbles_Stroke2_Corner2_Rounded as BubblesIcon} from '#/components/icons/Bubble' import {CloseQuote_Stroke2_Corner1_Rounded as QuoteIcon} from '#/components/icons/Quote' import {Repost_Stroke2_Corner2_Rounded as RepostIcon} from '#/components/icons/Repost' import * as Layout from '#/components/Layout' import * as SettingsList from './components/SettingsList' type Props = NativeStackScreenProps< CommonNavigatorParams, 'PreferencesFollowingFeed' > export function FollowingFeedPreferencesScreen({}: Props) { const {_} = useLingui() const {data: preferences} = usePreferencesQuery() const {mutate: setFeedViewPref, variables} = useSetFeedViewPreferencesMutation() const showReplies = !( variables?.hideReplies ?? preferences?.feedViewPrefs?.hideReplies ) const showReposts = !( variables?.hideReposts ?? preferences?.feedViewPrefs?.hideReposts ) const showQuotePosts = !( variables?.hideQuotePosts ?? preferences?.feedViewPrefs?.hideQuotePosts ) const mergeFeedEnabled = Boolean( variables?.lab_mergeFeedEnabled ?? preferences?.feedViewPrefs?.lab_mergeFeedEnabled, ) return ( Following Feed Preferences These settings only apply to the Following feed. setFeedViewPref({ hideReplies: !value, }) }> Show replies setFeedViewPref({ hideReposts: !value, }) }> Show reposts setFeedViewPref({ hideQuotePosts: !value, }) }> Show quote posts Experimental setFeedViewPref({ lab_mergeFeedEnabled: value, }) } style={[a.w_full, a.gap_md]}> Show samples of your saved feeds in your Following feed ) }