diff options
Diffstat (limited to 'src/components/AccountList.tsx')
-rw-r--r-- | src/components/AccountList.tsx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/components/AccountList.tsx b/src/components/AccountList.tsx index 76596df3e..7d696801e 100644 --- a/src/components/AccountList.tsx +++ b/src/components/AccountList.tsx @@ -16,12 +16,12 @@ export function AccountList({ onSelectAccount, onSelectOther, otherLabel, - isSwitchingAccounts, + pendingDid, }: { onSelectAccount: (account: SessionAccount) => void onSelectOther: () => void otherLabel?: string - isSwitchingAccounts: boolean + pendingDid: string | null }) { const {currentAccount, accounts} = useSession() const t = useTheme() @@ -33,6 +33,7 @@ export function AccountList({ return ( <View + pointerEvents={pendingDid ? 'none' : 'auto'} style={[ a.rounded_md, a.overflow_hidden, @@ -45,6 +46,7 @@ export function AccountList({ account={account} onSelect={onSelectAccount} isCurrentAccount={account.did === currentAccount?.did} + isPendingAccount={account.did === pendingDid} /> <View style={[a.border_b, t.atoms.border_contrast_low]} /> </React.Fragment> @@ -52,7 +54,7 @@ export function AccountList({ <Button testID="chooseAddAccountBtn" style={[a.flex_1]} - onPress={isSwitchingAccounts ? undefined : onPressAddAccount} + onPress={pendingDid ? undefined : onPressAddAccount} label={_(msg`Login to account that is not listed`)}> {({hovered, pressed}) => ( <View @@ -61,8 +63,7 @@ export function AccountList({ a.flex_row, a.align_center, {height: 48}, - (hovered || pressed || isSwitchingAccounts) && - t.atoms.bg_contrast_25, + (hovered || pressed) && t.atoms.bg_contrast_25, ]}> <Text style={[ @@ -86,10 +87,12 @@ function AccountItem({ account, onSelect, isCurrentAccount, + isPendingAccount, }: { account: SessionAccount onSelect: (account: SessionAccount) => void isCurrentAccount: boolean + isPendingAccount: boolean }) { const t = useTheme() const {_} = useLingui() @@ -117,7 +120,7 @@ function AccountItem({ a.flex_row, a.align_center, {height: 48}, - (hovered || pressed) && t.atoms.bg_contrast_25, + (hovered || pressed || isPendingAccount) && t.atoms.bg_contrast_25, ]}> <View style={a.p_md}> <UserAvatar avatar={profile?.avatar} size={24} /> |