Skip to content

Commit

Permalink
confirm sign out
Browse files Browse the repository at this point in the history
  • Loading branch information
attente committed Nov 10, 2024
1 parent 41416a2 commit ab20d40
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/routes/Wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ function Wallet() {
const [pendingSendToken, setPendingSendToken] = useState<TokenBalance | undefined>(undefined)
const [pendingSendCollectible, setPendingSendCollectible] = useState<CollectibleInfo | undefined>(undefined)

const [isConfirmSignOutModalOpen, setIsConfirmSignOutModalOpen] = useState(false)
const [isNetworkModalOpen, setIsNetworkModalOpen] = useState(false)
const [isSelectProviderModalOpen, setIsSelectProviderModalOpen] = useState(false)
const [isConnectingDapp, setIsConnectingDapp] = useState(false)
Expand Down Expand Up @@ -389,10 +390,7 @@ function Wallet() {
<Button
label="Sign Out"
variant="text"
onClick={() => {
authStore.logout()
navigate('/')
}}
onClick={() => setIsConfirmSignOutModalOpen(true)}
/>
</Box>
</Box>
Expand Down Expand Up @@ -530,6 +528,22 @@ function Wallet() {
</Box>
</Box>
</Box>
{isConfirmSignOutModalOpen && (
<Modal size="sm" onClose={() => setIsConfirmSignOutModalOpen(false)}>
<Box flexDirection="column" padding="8">
<Text color="text80" marginRight="8">
You will need to re-enter your mnemonic if you sign out. Continue?
</Text>
<Box flexDirection="row" width="full" justifyContent="flex-end" marginTop="8" gap="4">
<Button label="Sign Out" shape="square" variant="primary" onClick={() => {
authStore.logout()
navigate('/')
}} />
<Button label="Cancel" shape="square" onClick={() => setIsConfirmSignOutModalOpen(false)} />
</Box>
</Box>
</Modal>
)}
{isNetworkModalOpen && (
<Modal onClose={() => setIsNetworkModalOpen(false)}>
<Networks />
Expand Down

0 comments on commit ab20d40

Please sign in to comment.