From fa12bf5d877773a4b0719b35d70475380be24042 Mon Sep 17 00:00:00 2001 From: Hailey Date: Fri, 23 Aug 2024 13:28:56 -0700 Subject: [PATCH] Revert "Make settings account buttons a little nicer" (#4987) --- src/view/com/util/AccountDropdownBtn.tsx | 78 +++++++++++------------- src/view/screens/Settings/index.tsx | 71 +++++++++------------ 2 files changed, 66 insertions(+), 83 deletions(-) diff --git a/src/view/com/util/AccountDropdownBtn.tsx b/src/view/com/util/AccountDropdownBtn.tsx index 034fbfc6..fa2553d3 100644 --- a/src/view/com/util/AccountDropdownBtn.tsx +++ b/src/view/com/util/AccountDropdownBtn.tsx @@ -1,59 +1,53 @@ import React from 'react' -import {msg, Trans} from '@lingui/macro' +import {Pressable} from 'react-native' +import { + FontAwesomeIcon, + FontAwesomeIconStyle, +} from '@fortawesome/react-native-fontawesome' +import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' import {SessionAccount, useSessionApi} from '#/state/session' -import {HITSLOP_10} from 'lib/constants' -import {Button, ButtonIcon} from '#/components/Button' +import {usePalette} from 'lib/hooks/usePalette' +import {s} from 'lib/styles' import {useDialogControl} from '#/components/Dialog' -import {DotGrid_Stroke2_Corner0_Rounded as Ellipsis} from '#/components/icons/DotGrid' -import {Trash_Stroke2_Corner0_Rounded as Trash} from '#/components/icons/Trash' -import * as Menu from '#/components/Menu' import * as Prompt from '#/components/Prompt' import * as Toast from '../../com/util/Toast' +import {DropdownItem, NativeDropdown} from './forms/NativeDropdown' export function AccountDropdownBtn({account}: {account: SessionAccount}) { - const {_} = useLingui() + const pal = usePalette('default') const {removeAccount} = useSessionApi() const removePromptControl = useDialogControl() + const {_} = useLingui() + const items: DropdownItem[] = [ + { + label: _(msg`Remove account`), + onPress: removePromptControl.open, + icon: { + ios: { + name: 'trash', + }, + android: 'ic_delete', + web: ['far', 'trash-can'], + }, + }, + ] return ( <> - - - {({props}) => { - return ( - - ) - }} - - - - - { - removePromptControl.open() - }}> - - Remove account - - - - - - - + + + + + void }) { + const pal = usePalette('default') const {_} = useLingui() const t = useTheme() const {currentAccount} = useSession() const {data: profile} = useProfileQuery({did: account.did}) const isCurrentAccount = account.did === currentAccount?.did - const contents = (ctx: ButtonContext) => ( + const contents = ( - - - + + + + + {profile?.displayName || account.handle} - - - {sanitizeHandle(account.handle, '@')} - + + + {account.handle} + ) return isCurrentAccount ? ( - + title={_(msg`Your profile`)} + noFeedback> {contents} - + ) : ( - + ) }