From ad91029f109d3eac22c811f3aee7ec55c314dbe5 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Mon, 10 Nov 2025 16:02:53 +0200 Subject: [PATCH] Select account redesign (#8905) * new designs for select account * tweak web styles * add logged out indicator * unify helper function * move error, try catch --- src/components/AccountList.tsx | 82 +++++++++++++++++------- src/components/dialogs/SwitchAccount.tsx | 2 +- src/lib/jwt.ts | 23 +++++++ src/screens/Login/ChooseAccountForm.tsx | 5 +- src/state/session/util.ts | 17 ++--- 5 files changed, 90 insertions(+), 39 deletions(-) create mode 100644 src/lib/jwt.ts diff --git a/src/components/AccountList.tsx b/src/components/AccountList.tsx index e01ca31d2c..70fc29d5b6 100644 --- a/src/components/AccountList.tsx +++ b/src/components/AccountList.tsx @@ -5,18 +5,20 @@ import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useActorStatus} from '#/lib/actor-status' +import {isJwtExpired} from '#/lib/jwt' import {sanitizeDisplayName} from '#/lib/strings/display-names' import {sanitizeHandle} from '#/lib/strings/handles' import {useProfilesQuery} from '#/state/queries/profile' import {type SessionAccount, useSession} from '#/state/session' import {UserAvatar} from '#/view/com/util/UserAvatar' import {atoms as a, useTheme} from '#/alf' -import {Check_Stroke2_Corner0_Rounded as Check} from '#/components/icons/Check' -import {ChevronRight_Stroke2_Corner0_Rounded as Chevron} from '#/components/icons/Chevron' +import {Button} from '#/components/Button' +import {CheckThick_Stroke2_Corner0_Rounded as CheckIcon} from '#/components/icons/Check' +import {ChevronRight_Stroke2_Corner0_Rounded as ChevronIcon} from '#/components/icons/Chevron' +import {PlusLarge_Stroke2_Corner0_Rounded as PlusIcon} from '#/components/icons/Plus' +import {Text} from '#/components/Typography' import {useSimpleVerificationState} from '#/components/verification' import {VerificationCheck} from '#/components/verification/VerificationCheck' -import {Button} from './Button' -import {Text} from './Typography' export function AccountList({ onSelectAccount, @@ -44,9 +46,9 @@ export function AccountList({ {accounts.map(account => ( @@ -58,7 +60,7 @@ export function AccountList({ isCurrentAccount={account.did === currentAccount?.did} isPendingAccount={account.did === pendingDid} /> - + ))} @@ -117,6 +122,8 @@ function AccountItem({ onSelect(account) }, [account, onSelect]) + const isLoggedOut = !account.refreshJwt || isJwtExpired(account.refreshJwt) + return (