Move require alt-text to new persistence + context (#1839)

This commit is contained in:
Paul Frazee 2023-11-08 08:52:01 -08:00 committed by GitHub
parent 2acc88e78d
commit 3a211017d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 69 additions and 25 deletions

View file

@ -50,6 +50,8 @@ import {
useSetMinimalShellMode,
useColorMode,
useSetColorMode,
useRequireAltTextEnabled,
useSetRequireAltTextEnabled,
} from '#/state/shell'
// TEMPORARY (APP-700)
@ -66,6 +68,8 @@ export const SettingsScreen = withAuthRequired(
const pal = usePalette('default')
const store = useStores()
const setMinimalShellMode = useSetMinimalShellMode()
const requireAltTextEnabled = useRequireAltTextEnabled()
const setRequireAltTextEnabled = useSetRequireAltTextEnabled()
const navigation = useNavigation<NavigationProp>()
const {isMobile} = useWebMediaQueries()
const {screen, track} = useAnalytics()
@ -372,8 +376,8 @@ export const SettingsScreen = withAuthRequired(
type="default-light"
label="Require alt text before posting"
labelType="lg"
isSelected={store.preferences.requireAltTextEnabled}
onPress={store.preferences.toggleRequireAltTextEnabled}
isSelected={requireAltTextEnabled}
onPress={() => setRequireAltTextEnabled(!requireAltTextEnabled)}
/>
</View>