Skip to content

Commit 60622d8

Browse files
chore(storybook): add LockWalletConfirmDialog story
1 parent ec4aae8 commit 60622d8

File tree

2 files changed

+72
-16
lines changed

2 files changed

+72
-16
lines changed

src/components/ui/jam/LockWalletConfirmDialog.tsx

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,20 @@ export const LockWalletConfirmDialog = ({
3333
<DialogHeader>
3434
<DialogTitle>{t('wallets.wallet_preview.modal_lock_wallet_title')}</DialogTitle>
3535
</DialogHeader>
36-
<div className="flex flex-col gap-2">
37-
{makerRunning && (
38-
<Alert variant="warning">
39-
<AlertTriangleIcon />
40-
<AlertDescription>{t('wallets.wallet_preview.modal_lock_wallet_maker_running_text')}</AlertDescription>
41-
</Alert>
42-
)}
43-
{coinjoinInProgress && (
44-
<Alert variant="warning">
45-
<AlertTriangleIcon />
46-
<AlertDescription>
47-
{t('wallets.wallet_preview.modal_lock_wallet_coinjoin_in_progress_text')}
48-
</AlertDescription>
49-
</Alert>
50-
)}
51-
</div>
36+
{makerRunning && (
37+
<Alert variant="warning">
38+
<AlertTriangleIcon />
39+
<AlertDescription>{t('wallets.wallet_preview.modal_lock_wallet_maker_running_text')}</AlertDescription>
40+
</Alert>
41+
)}
42+
{coinjoinInProgress && (
43+
<Alert variant="warning">
44+
<AlertTriangleIcon />
45+
<AlertDescription>
46+
{t('wallets.wallet_preview.modal_lock_wallet_coinjoin_in_progress_text')}
47+
</AlertDescription>
48+
</Alert>
49+
)}
5250
<p className="text-muted-foreground">{t('wallets.wallet_preview.modal_lock_wallet_alternative_action_text')}</p>
5351
<DialogFooter>
5452
<Button variant="outline" onClick={() => onOpenChange(false)} disabled={isLocking}>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import { useState } from 'react'
2+
import type { Meta, StoryObj } from '@storybook/react-vite'
3+
import { Button } from '@/components/ui/button'
4+
import { LockWalletConfirmDialog } from '@/components/ui/jam/LockWalletConfirmDialog'
5+
6+
const meta: Meta<typeof LockWalletConfirmDialog> = {
7+
title: 'Dialog/LockWalletConfirmDialog',
8+
component: LockWalletConfirmDialog,
9+
tags: ['autodocs'],
10+
render: (args) => {
11+
const [open, setOpen] = useState(false)
12+
return (
13+
<>
14+
<Button onClick={() => setOpen(true)}>Open</Button>
15+
<LockWalletConfirmDialog {...args} open={open} onOpenChange={() => setOpen(false)} />
16+
</>
17+
)
18+
},
19+
}
20+
export default meta
21+
22+
type Story = StoryObj<typeof LockWalletConfirmDialog>
23+
24+
export const Default: Story = {
25+
args: {
26+
coinjoinInProgress: false,
27+
makerRunning: false,
28+
isLocking: false,
29+
onConfirm: async () => alert('Confirm clicked!'),
30+
},
31+
}
32+
33+
export const MakerRunning: Story = {
34+
args: {
35+
coinjoinInProgress: false,
36+
makerRunning: true,
37+
isLocking: false,
38+
onConfirm: async () => alert('Confirm clicked!'),
39+
},
40+
}
41+
42+
export const CoinjoinInProgress: Story = {
43+
args: {
44+
coinjoinInProgress: true,
45+
makerRunning: false,
46+
isLocking: false,
47+
onConfirm: async () => alert('Confirm clicked!'),
48+
},
49+
}
50+
51+
export const Locking: Story = {
52+
args: {
53+
coinjoinInProgress: true,
54+
makerRunning: false,
55+
isLocking: true,
56+
onConfirm: async () => alert('Confirm clicked!'),
57+
},
58+
}

0 commit comments

Comments
 (0)