Skip to content

Commit

Permalink
chore: change to vault button
Browse files Browse the repository at this point in the history
  • Loading branch information
apotdevin committed Jun 22, 2024
1 parent 72c5b08 commit dc3782a
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions src/views/wallet/Settings.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
'use client';

import { Copy, CopyCheck, Shield } from 'lucide-react';
import { Copy, CopyCheck } from 'lucide-react';
import { FC, useEffect, useRef, useState } from 'react';
import { useCopyToClipboard } from 'usehooks-ts';

import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
import { VaultButton } from '@/components/button/VaultButton';
import { Button } from '@/components/ui/button';
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from '@/components/ui/card';
Expand Down Expand Up @@ -142,13 +141,17 @@ export const WalletSettings: FC<{ walletId: string }> = ({ walletId }) => {
readOnly
defaultValue={protectedMnemonic}
/>
<Button
className="w-40"
disabled={loading || !!mnemonic || !masterKey}
onClick={() => handleDecrypt()}
>
Decrypt
</Button>
{!masterKey ? (
<VaultButton lockedTitle="Unlock to Decrypt" />
) : (
<Button
className="w-40"
disabled={loading || !!mnemonic || !masterKey}
onClick={() => handleDecrypt()}
>
Decrypt
</Button>
)}
</div>
</div>

Expand All @@ -171,17 +174,6 @@ export const WalletSettings: FC<{ walletId: string }> = ({ walletId }) => {
</div>
</div>
</CardContent>
{!masterKey ? (
<CardFooter>
<Alert variant={'destructive'}>
<Shield color="red" className="size-4" />
<AlertTitle>Vault Locked!</AlertTitle>
<AlertDescription>
To decrypt your mnemonic you need to unlock your vault first.
</AlertDescription>
</Alert>
</CardFooter>
) : null}
</Card>
</div>
);
Expand Down

0 comments on commit dc3782a

Please sign in to comment.