Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Require age assurance to access chat settings (#10053)

authored by

DS Boyce and committed by
GitHub
d58ff894 014ffac9

+25 -10
+13 -9
src/screens/Messages/ChatList.tsx
··· 38 38 import {Link} from '#/components/Link' 39 39 import {ListFooter} from '#/components/Lists' 40 40 import {Text} from '#/components/Typography' 41 + import {useAgeAssurance} from '#/ageAssurance' 41 42 import {IS_NATIVE} from '#/env' 42 43 import {ChatListItem} from './components/ChatListItem' 43 44 import {InboxPreview} from './components/InboxPreview' ··· 71 72 export function MessagesScreen(props: Props) { 72 73 const {_} = useLingui() 73 74 const aaCopy = useAgeAssuranceCopy() 75 + const aa = useAgeAssurance() 74 76 75 77 return ( 76 78 <AgeRestrictedScreen 77 79 screenTitle={_(msg`Chats`)} 78 80 infoText={aaCopy.chatsInfoText} 79 81 rightHeaderSlot={ 80 - <Link 81 - to="/messages/settings" 82 - label={_(msg`Chat settings`)} 83 - size="small" 84 - color="secondary"> 85 - <ButtonText> 86 - <Trans>Chat settings</Trans> 87 - </ButtonText> 88 - </Link> 82 + aa.flags.chatDisabled ? null : ( 83 + <Link 84 + to="/messages/settings" 85 + label={_(msg`Chat settings`)} 86 + size="small" 87 + color="secondary"> 88 + <ButtonText> 89 + <Trans>Chat settings</Trans> 90 + </ButtonText> 91 + </Link> 92 + ) 89 93 }> 90 94 <MessagesScreenInner {...props} /> 91 95 </AgeRestrictedScreen>
+12 -1
src/screens/Messages/Settings.tsx
··· 11 11 import {useSession} from '#/state/session' 12 12 import {atoms as a} from '#/alf' 13 13 import {Admonition} from '#/components/Admonition' 14 + import {AgeRestrictedScreen} from '#/components/ageAssurance/AgeRestrictedScreen' 15 + import {useAgeAssuranceCopy} from '#/components/ageAssurance/useAgeAssuranceCopy' 14 16 import {Divider} from '#/components/Divider' 15 17 import * as Toggle from '#/components/forms/Toggle' 16 18 import * as Layout from '#/components/Layout' ··· 24 26 type Props = NativeStackScreenProps<CommonNavigatorParams, 'MessagesSettings'> 25 27 26 28 export function MessagesSettingsScreen(props: Props) { 27 - return <MessagesSettingsScreenInner {...props} /> 29 + const {_} = useLingui() 30 + const aaCopy = useAgeAssuranceCopy() 31 + 32 + return ( 33 + <AgeRestrictedScreen 34 + screenTitle={_(msg`Chat settings`)} 35 + infoText={aaCopy.chatsInfoText}> 36 + <MessagesSettingsScreenInner {...props} /> 37 + </AgeRestrictedScreen> 38 + ) 28 39 } 29 40 30 41 export function MessagesSettingsScreenInner({}: Props) {