import React from 'react' import {StyleSheet, TouchableOpacity, View} from 'react-native' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {ScrollView} from 'react-native-gesture-handler' import {Text} from '../com/util/text/Text' import {Button} from '../com/util/forms/Button' import * as Toast from '../com/util/Toast' import {useStores} from 'state/index' import {usePalette} from 'lib/hooks/usePalette' import {isDesktopWeb} from 'platform/detection' import {withAuthRequired} from 'view/com/auth/withAuthRequired' import {observer} from 'mobx-react-lite' import {NativeStackScreenProps} from '@react-navigation/native-stack' import {CommonNavigatorParams} from 'lib/routes/types' import {useAnalytics} from 'lib/analytics' import {useFocusEffect} from '@react-navigation/native' import {ViewHeader} from '../com/util/ViewHeader' import {CenteredView} from 'view/com/util/Views' type Props = NativeStackScreenProps export const AppPasswords = withAuthRequired( observer(({}: Props) => { const pal = usePalette('default') const store = useStores() const {screen} = useAnalytics() useFocusEffect( React.useCallback(() => { screen('AppPasswords') store.shell.setMinimalShellMode(false) }, [screen, store]), ) const onAdd = React.useCallback(async () => { store.shell.openModal({name: 'add-app-password'}) }, [store]) // no app passwords (empty) state if (store.me.appPasswords.length === 0) { return ( You have not created any app passwords yet. You can create one by pressing the button below. {!isDesktopWeb && }