import React from 'react' import { ActivityIndicator, StyleSheet, TouchableOpacity, View, } from 'react-native' import {Text} from '../util/text/Text' import {useStores} from 'state/index' import {s} from 'lib/styles' import {usePalette} from 'lib/hooks/usePalette' import {useAnalytics} from 'lib/analytics/analytics' import {useAccountSwitcher} from 'lib/hooks/useAccountSwitcher' import {UserAvatar} from '../util/UserAvatar' import {AccountDropdownBtn} from '../util/AccountDropdownBtn' import {Link} from '../util/Link' import {makeProfileLink} from 'lib/routes/links' import {BottomSheetScrollView} from '@gorhom/bottom-sheet' import {Haptics} from 'lib/haptics' export const snapPoints = ['40%', '90%'] export function Component({}: {}) { const pal = usePalette('default') const {track} = useAnalytics() const store = useStores() const [isSwitching, _, onPressSwitchAccount] = useAccountSwitcher() React.useEffect(() => { Haptics.default() }) const onPressSignout = React.useCallback(() => { track('Settings:SignOutButtonClicked') store.session.logout() }, [track, store]) return ( Switch Account {isSwitching ? ( ) : ( {store.me.displayName || store.me.handle} {store.me.handle} Sign out )} {store.session.switchableAccounts.map(account => ( onPressSwitchAccount(account) } accessibilityRole="button" accessibilityLabel={`Switch to ${account.handle}`} accessibilityHint="Switches the account you are logged in to"> {account.displayName || account.handle} {account.handle} ))} ) } const styles = StyleSheet.create({ container: { flex: 1, }, innerContainer: { paddingBottom: 40, }, title: { textAlign: 'center', marginTop: 12, marginBottom: 12, }, linkCard: { flexDirection: 'row', alignItems: 'center', paddingVertical: 12, paddingHorizontal: 18, marginBottom: 1, }, avi: { marginRight: 12, }, dimmed: { opacity: 0.5, }, })