Create shared preferences API (#4654)

This commit is contained in:
Hailey 2024-07-11 18:37:43 -07:00 committed by GitHub
parent 2397104ad6
commit 83e8522e0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 722 additions and 81 deletions

View file

@ -1,7 +1,9 @@
import React from 'react'
import {View} from 'react-native'
import {useNavigation} from '@react-navigation/native'
import {useDialogStateControlContext} from '#/state/dialogs'
import {NavigationProp} from 'lib/routes/types'
import {atoms as a} from '#/alf'
import {Button, ButtonText} from '#/components/Button'
import * as Dialog from '#/components/Dialog'
@ -18,6 +20,7 @@ export function Dialogs() {
const [shouldRenderUnmountTest, setShouldRenderUnmountTest] =
React.useState(false)
const unmountTestInterval = React.useRef<number>()
const navigation = useNavigation<NavigationProp>()
const onUnmountTestStartPressWithClose = () => {
setShouldRenderUnmountTest(true)
@ -134,6 +137,16 @@ export function Dialogs() {
<ButtonText>End Unmount Test</ButtonText>
</Button>
<Button
variant="solid"
color="primary"
size="small"
onPress={() => navigation.navigate('SharedPreferencesTester')}
label="two"
testID="sharedPrefsTestOpenBtn">
<ButtonText>Open Shared Prefs Tester</ButtonText>
</Button>
<Prompt.Outer control={prompt}>
<Prompt.TitleText>This is a prompt</Prompt.TitleText>
<Prompt.DescriptionText>