Bluesky app fork with some witchin' additions 💫 witchsky.app
bluesky fork client
117
fork

Configure Feed

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

Rename moderation link in settings to "Moderation and content filters" (#10192)

authored by

Samuel Newman and committed by
GitHub
2c717dc1 ff68e403

+49 -55
+49 -55
src/screens/Settings/Settings.tsx
··· 2 2 import {Alert, LayoutAnimation, Linking, Pressable, View} from 'react-native' 3 3 import {useReducedMotion} from 'react-native-reanimated' 4 4 import {type AppBskyActorDefs, moderateProfile} from '@atproto/api' 5 - import {msg} from '@lingui/core/macro' 6 - import {useLingui} from '@lingui/react' 7 - import {Trans} from '@lingui/react/macro' 5 + import {Trans, useLingui} from '@lingui/react/macro' 8 6 import {useNavigation} from '@react-navigation/native' 9 7 import {type NativeStackScreenProps} from '@react-navigation/native-stack' 10 8 ··· 73 71 type Props = NativeStackScreenProps<CommonNavigatorParams, 'Settings'> 74 72 export function SettingsScreen({}: Props) { 75 73 const ax = useAnalytics() 76 - const {_} = useLingui() 74 + const {t: l} = useLingui() 77 75 const reducedMotion = useReducedMotion() 78 76 const {logoutEveryAccount} = useSessionApi() 79 77 const {accounts, currentAccount} = useSession() ··· 121 119 {accounts.length > 1 ? ( 122 120 <> 123 121 <SettingsList.PressableItem 124 - label={_(msg`Switch account`)} 125 - accessibilityHint={_( 126 - msg`Shows other accounts you can switch to`, 127 - )} 122 + label={l`Switch account`} 123 + accessibilityHint={l`Shows other accounts you can switch to`} 128 124 onPress={() => { 129 125 if (!reducedMotion) { 130 126 LayoutAnimation.configureNext( ··· 174 170 <AddAccountRow /> 175 171 )} 176 172 <SettingsList.Divider /> 177 - <SettingsList.LinkItem to="/settings/account" label={_(msg`Account`)}> 173 + <SettingsList.LinkItem to="/settings/account" label={l`Account`}> 178 174 <SettingsList.ItemIcon icon={PersonIcon} /> 179 175 <SettingsList.ItemText> 180 176 <Trans>Account</Trans> ··· 182 178 </SettingsList.LinkItem> 183 179 <SettingsList.LinkItem 184 180 to="/settings/privacy-and-security" 185 - label={_(msg`Privacy and security`)}> 181 + label={l`Privacy and security`}> 186 182 <SettingsList.ItemIcon icon={LockIcon} /> 187 183 <SettingsList.ItemText> 188 184 <Trans>Privacy and security</Trans> 189 185 </SettingsList.ItemText> 190 186 </SettingsList.LinkItem> 191 - <SettingsList.LinkItem to="/moderation" label={_(msg`Moderation`)}> 187 + <SettingsList.LinkItem 188 + to="/moderation" 189 + label={l`Moderation and content filters`}> 192 190 <SettingsList.ItemIcon icon={HandIcon} /> 193 191 <SettingsList.ItemText> 194 - <Trans>Moderation</Trans> 192 + <Trans>Moderation and content filters</Trans> 195 193 </SettingsList.ItemText> 196 194 </SettingsList.LinkItem> 197 195 <SettingsList.LinkItem 198 196 to="/settings/notifications" 199 - label={_(msg`Notifications`)}> 197 + label={l`Notifications`}> 200 198 <SettingsList.ItemIcon icon={NotificationIcon} /> 201 199 <SettingsList.ItemText> 202 200 <Trans>Notifications</Trans> ··· 204 202 </SettingsList.LinkItem> 205 203 <SettingsList.LinkItem 206 204 to="/settings/content-and-media" 207 - label={_(msg`Content and media`)}> 205 + label={l`Content and media`}> 208 206 <SettingsList.ItemIcon icon={WindowIcon} /> 209 207 <SettingsList.ItemText> 210 208 <Trans>Content and media</Trans> ··· 215 213 !ax.features.enabled(ax.features.ImportContactsSettingsDisable) && ( 216 214 <SettingsList.LinkItem 217 215 to="/settings/find-contacts" 218 - label={_(msg`Find friends from contacts`)}> 216 + label={l`Find friends from contacts`}> 219 217 <SettingsList.ItemIcon icon={ContactsIcon} /> 220 218 <SettingsList.ItemText> 221 219 <Trans>Find friends from contacts</Trans> ··· 224 222 )} 225 223 <SettingsList.LinkItem 226 224 to="/settings/appearance" 227 - label={_(msg`Appearance`)}> 225 + label={l`Appearance`}> 228 226 <SettingsList.ItemIcon icon={PaintRollerIcon} /> 229 227 <SettingsList.ItemText> 230 228 <Trans>Appearance</Trans> ··· 232 230 </SettingsList.LinkItem> 233 231 <SettingsList.LinkItem 234 232 to="/settings/accessibility" 235 - label={_(msg`Accessibility`)}> 233 + label={l`Accessibility`}> 236 234 <SettingsList.ItemIcon icon={AccessibilityIcon} /> 237 235 <SettingsList.ItemText> 238 236 <Trans>Accessibility</Trans> 239 237 </SettingsList.ItemText> 240 238 </SettingsList.LinkItem> 241 - <SettingsList.LinkItem 242 - to="/settings/language" 243 - label={_(msg`Languages`)}> 239 + <SettingsList.LinkItem to="/settings/language" label={l`Languages`}> 244 240 <SettingsList.ItemIcon icon={EarthIcon} /> 245 241 <SettingsList.ItemText> 246 242 <Trans>Languages</Trans> ··· 248 244 </SettingsList.LinkItem> 249 245 <SettingsList.PressableItem 250 246 onPress={() => void Linking.openURL(HELP_DESK_URL)} 251 - label={_(msg`Help`)} 252 - accessibilityHint={_(msg`Opens helpdesk in browser`)}> 247 + label={l`Help`} 248 + accessibilityHint={l`Opens helpdesk in browser`}> 253 249 <SettingsList.ItemIcon icon={CircleQuestionIcon} /> 254 250 <SettingsList.ItemText> 255 251 <Trans>Help</Trans> 256 252 </SettingsList.ItemText> 257 253 <SettingsList.Chevron /> 258 254 </SettingsList.PressableItem> 259 - <SettingsList.LinkItem to="/settings/about" label={_(msg`About`)}> 255 + <SettingsList.LinkItem to="/settings/about" label={l`About`}> 260 256 <SettingsList.ItemIcon icon={BubbleInfoIcon} /> 261 257 <SettingsList.ItemText> 262 258 <Trans>About</Trans> ··· 266 262 <SettingsList.PressableItem 267 263 destructive 268 264 onPress={() => signOutPromptControl.open()} 269 - label={_(msg`Sign out`)}> 265 + label={l`Sign out`}> 270 266 <SettingsList.ItemText> 271 267 <Trans>Sign out</Trans> 272 268 </SettingsList.ItemText> ··· 283 279 } 284 280 setShowDevOptions(d => !d) 285 281 }} 286 - label={_(msg`Developer options`)}> 282 + label={l`Developer options`}> 287 283 <SettingsList.ItemIcon icon={CodeBracketsIcon} /> 288 284 <SettingsList.ItemText> 289 285 <Trans>Developer options</Trans> ··· 297 293 298 294 <Prompt.Basic 299 295 control={signOutPromptControl} 300 - title={_(msg`Sign out?`)} 301 - description={_(msg`You will be signed out of all your accounts.`)} 296 + title={l`Sign out?`} 297 + description={l`You will be signed out of all your accounts.`} 302 298 onConfirm={() => logoutEveryAccount('Settings')} 303 - confirmButtonCta={_(msg`Sign out`)} 304 - cancelButtonCta={_(msg`Cancel`)} 299 + confirmButtonCta={l`Sign out`} 300 + cancelButtonCta={l`Cancel`} 305 301 confirmButtonColor="negative" 306 302 /> 307 303 ··· 378 374 } 379 375 380 376 function DevOptions() { 381 - const {_} = useLingui() 377 + const {t: l} = useLingui() 382 378 const agent = useAgent() 383 379 const [override, setOverride] = useStorage(device, [ 384 380 'policyUpdateDebugOverride', ··· 397 393 const resetOnboarding = () => { 398 394 navigation.navigate('Home') 399 395 onboardingDispatch({type: 'start'}) 400 - Toast.show(_(msg`Onboarding reset`)) 396 + Toast.show(l`Onboarding reset`) 401 397 } 402 398 403 399 const clearAllStorage = async () => { 404 400 await clearStorage() 405 - Toast.show(_(msg`Storage cleared, you need to restart the app now.`)) 401 + Toast.show(l`Storage cleared, you need to restart the app now.`) 406 402 } 407 403 408 404 const onPressUnsnoozeReminder = () => { ··· 413 409 ...persisted.get('reminders'), 414 410 lastEmailConfirm: lastEmailConfirm.toISOString(), 415 411 }) 416 - Toast.show(_(msg`You probably want to restart the app now.`)) 412 + Toast.show(l`You probably want to restart the app now.`) 417 413 } 418 414 419 415 const onPressActySubsUnNudge = () => { ··· 448 444 <> 449 445 <SettingsList.PressableItem 450 446 onPress={() => navigation.navigate('Log')} 451 - label={_(msg`Open system log`)}> 447 + label={l`Open system log`}> 452 448 <SettingsList.ItemText> 453 449 <Trans>System log</Trans> 454 450 </SettingsList.ItemText> 455 451 </SettingsList.PressableItem> 456 452 <SettingsList.PressableItem 457 453 onPress={() => navigation.navigate('Debug')} 458 - label={_(msg`Open storybook page`)}> 454 + label={l`Open storybook page`}> 459 455 <SettingsList.ItemText> 460 456 <Trans>Storybook</Trans> 461 457 </SettingsList.ItemText> 462 458 </SettingsList.PressableItem> 463 459 <SettingsList.PressableItem 464 460 onPress={() => navigation.navigate('DebugMod')} 465 - label={_(msg`Open moderation debug page`)}> 461 + label={l`Open moderation debug page`}> 466 462 <SettingsList.ItemText> 467 463 <Trans>Debug Moderation</Trans> 468 464 </SettingsList.ItemText> 469 465 </SettingsList.PressableItem> 470 466 <SettingsList.PressableItem 471 467 onPress={() => deleteChatDeclarationRecord()} 472 - label={_(msg`Open storybook page`)}> 468 + label={l`Open storybook page`}> 473 469 <SettingsList.ItemText> 474 470 <Trans>Delete chat declaration record</Trans> 475 471 </SettingsList.ItemText> 476 472 </SettingsList.PressableItem> 477 473 <SettingsList.PressableItem 478 474 onPress={() => void resetOnboarding()} 479 - label={_(msg`Reset onboarding state`)}> 475 + label={l`Reset onboarding state`}> 480 476 <SettingsList.ItemText> 481 477 <Trans>Reset onboarding state</Trans> 482 478 </SettingsList.ItemText> 483 479 </SettingsList.PressableItem> 484 480 <SettingsList.PressableItem 485 481 onPress={onPressUnsnoozeReminder} 486 - label={_(msg`Unsnooze email reminder`)}> 482 + label={l`Unsnooze email reminder`}> 487 483 <SettingsList.ItemText> 488 484 <Trans>Unsnooze email reminder</Trans> 489 485 </SettingsList.ItemText> ··· 491 487 {actyNotifNudged && ( 492 488 <SettingsList.PressableItem 493 489 onPress={onPressActySubsUnNudge} 494 - label={_(msg`Reset activity subscription nudge`)}> 490 + label={l`Reset activity subscription nudge`}> 495 491 <SettingsList.ItemText> 496 492 <Trans>Reset activity subscription nudge</Trans> 497 493 </SettingsList.ItemText> ··· 499 495 )} 500 496 <SettingsList.PressableItem 501 497 onPress={() => void clearAllStorage()} 502 - label={_(msg`Clear all storage data`)}> 498 + label={l`Clear all storage data`}> 503 499 <SettingsList.ItemText> 504 500 <Trans>Clear all storage data (restart after this)</Trans> 505 501 </SettingsList.ItemText> ··· 507 503 {IS_IOS ? ( 508 504 <SettingsList.PressableItem 509 505 onPress={onPressApplyOta} 510 - label={_(msg`Apply Pull Request`)}> 506 + label={l`Apply Pull Request`}> 511 507 <SettingsList.ItemText> 512 508 <Trans>Apply Pull Request</Trans> 513 509 </SettingsList.ItemText> ··· 516 512 {IS_NATIVE && isCurrentlyRunningPullRequestDeployment ? ( 517 513 <SettingsList.PressableItem 518 514 onPress={() => void revertToEmbedded()} 519 - label={_(msg`Unapply Pull Request`)}> 515 + label={l`Unapply Pull Request`}> 520 516 <SettingsList.ItemText> 521 517 <Trans>Unapply Pull Request {currentChannel}</Trans> 522 518 </SettingsList.ItemText> ··· 564 560 } 565 561 566 562 function AddAccountRow() { 567 - const {_} = useLingui() 563 + const {t: l} = useLingui() 568 564 const {setShowLoggedOut} = useLoggedOutViewControls() 569 565 const closeEverything = useCloseAllActiveElements() 570 566 ··· 576 572 return ( 577 573 <SettingsList.PressableItem 578 574 onPress={onAddAnotherAccount} 579 - label={_(msg`Add another account`)}> 575 + label={l`Add another account`}> 580 576 <SettingsList.ItemIcon icon={PersonPlusIcon} /> 581 577 <SettingsList.ItemText> 582 578 <Trans>Add another account</Trans> ··· 599 595 logContext: 'Settings', 600 596 ) => void 601 597 }) { 602 - const {_} = useLingui() 598 + const {t: l} = useLingui() 603 599 const t = useTheme() 604 600 605 601 const moderationOpts = useModerationOpts() ··· 616 612 <View style={[a.relative]}> 617 613 <SettingsList.PressableItem 618 614 onPress={onSwitchAccount} 619 - label={_(msg`Switch account`)}> 615 + label={l`Switch account`}> 620 616 {moderationOpts && profile ? ( 621 617 <UserAvatar 622 618 size={28} ··· 638 634 </SettingsList.PressableItem> 639 635 {!pendingDid && ( 640 636 <Menu.Root> 641 - <Menu.Trigger label={_(msg`Account options`)}> 637 + <Menu.Trigger label={l`Account options`}> 642 638 {({props, state}) => ( 643 639 <Pressable 644 640 {...props} ··· 655 651 </Menu.Trigger> 656 652 <Menu.Outer showCancel> 657 653 <Menu.Item 658 - label={_(msg`Remove account`)} 654 + label={l`Remove account`} 659 655 onPress={() => removePromptControl.open()}> 660 656 <Menu.ItemText> 661 657 <Trans>Remove account</Trans> ··· 668 664 669 665 <Prompt.Basic 670 666 control={removePromptControl} 671 - title={_(msg`Remove from quick access?`)} 672 - description={_( 673 - msg`This will remove @${account.handle} from the quick access list.`, 674 - )} 667 + title={l`Remove from quick access?`} 668 + description={l`This will remove @${account.handle} from the quick access list.`} 675 669 onConfirm={() => { 676 670 removeAccount(account) 677 - Toast.show(_(msg`Account removed from quick access`)) 671 + Toast.show(l`Account removed from quick access`) 678 672 }} 679 - confirmButtonCta={_(msg`Remove`)} 673 + confirmButtonCta={l`Remove`} 680 674 confirmButtonColor="negative" 681 675 /> 682 676 </View>