[Session] Extract selectAccount out (#3812)
This commit is contained in:
parent
5ec945b762
commit
1a07e23192
7 changed files with 48 additions and 42 deletions
|
@ -16,12 +16,14 @@ export function AccountList({
|
|||
onSelectAccount,
|
||||
onSelectOther,
|
||||
otherLabel,
|
||||
isSwitchingAccounts,
|
||||
}: {
|
||||
onSelectAccount: (account: SessionAccount) => void
|
||||
onSelectOther: () => void
|
||||
otherLabel?: string
|
||||
isSwitchingAccounts: boolean
|
||||
}) {
|
||||
const {isSwitchingAccounts, currentAccount, accounts} = useSession()
|
||||
const {currentAccount, accounts} = useSession()
|
||||
const t = useTheme()
|
||||
const {_} = useLingui()
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ export function SwitchAccountDialog({
|
|||
}) {
|
||||
const {_} = useLingui()
|
||||
const {currentAccount} = useSession()
|
||||
const {onPressSwitchAccount} = useAccountSwitcher()
|
||||
const {onPressSwitchAccount, isSwitchingAccounts} = useAccountSwitcher()
|
||||
const {setShowLoggedOut} = useLoggedOutViewControls()
|
||||
|
||||
const onSelectAccount = useCallback(
|
||||
|
@ -54,6 +54,7 @@ export function SwitchAccountDialog({
|
|||
onSelectAccount={onSelectAccount}
|
||||
onSelectOther={onPressAddAccount}
|
||||
otherLabel={_(msg`Add account`)}
|
||||
isSwitchingAccounts={isSwitchingAccounts}
|
||||
/>
|
||||
</View>
|
||||
</Dialog.ScrollableInner>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue