Skip to content

Commit 098b49e

Browse files
feat(Simulator/screens/ConnectWeb3): create stories for main component
1 parent d8c3e2d commit 098b49e

File tree

3 files changed

+70
-2
lines changed

3 files changed

+70
-2
lines changed

src/components/Simulator/screens/ConnectWeb3/Web3App.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { GrMenu } from "react-icons/gr"
33

44
import { HStack } from "@/components/ui/flex"
55

6+
import { cn } from "@/lib/utils/cn"
7+
68
import { FAKE_DEMO_ADDRESS } from "../../constants"
79
import { EthGlyphIcon } from "../../icons"
810
import { NotificationPopover } from "../../NotificationPopover"
@@ -15,10 +17,14 @@ export const Web3App = ({
1517
displayUrl,
1618
appName,
1719
children,
20+
className,
1821
...rest
1922
}: Web3AppProps) => {
2023
return (
21-
<div className="size-full bg-background-highlight" {...rest}>
24+
<div
25+
className={cn("size-full bg-background-highlight", className)}
26+
{...rest}
27+
>
2228
<div className="bg-[#e8e8e8] p-1 dark:bg-[#171717]">
2329
<p className="text-center text-xs">{displayUrl}</p>
2430
</div>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import type { Meta, StoryObj } from "@storybook/react/*"
2+
import { fn } from "@storybook/test"
3+
4+
import { Phone } from "@/components/Simulator/Phone"
5+
import { Template } from "@/components/Simulator/Template"
6+
7+
import { ConnectWeb3 as Component } from "../"
8+
9+
const meta = {
10+
title: "Molecules / Display Content / Simulator / ConnectWeb3 Screen",
11+
component: Component,
12+
parameters: {
13+
layout: "fullscreen",
14+
},
15+
decorators: [
16+
(Story) => (
17+
<div className="mx-auto mt-8">
18+
<Template>
19+
<Phone>
20+
<Story />
21+
</Phone>
22+
</Template>
23+
</div>
24+
),
25+
],
26+
args: {
27+
nav: {
28+
progressStepper: fn(),
29+
step: 0,
30+
openPath: fn(),
31+
regressStepper: fn(),
32+
totalSteps: 3,
33+
},
34+
ctaLabel: "Visit NFT market",
35+
},
36+
} satisfies Meta<typeof Component>
37+
38+
export default meta
39+
40+
type Story = StoryObj<typeof meta>
41+
42+
export const Initial: Story = {}
43+
44+
export const SliderNotConnected: Story = {
45+
args: {
46+
nav: {
47+
...meta.args.nav,
48+
step: 2,
49+
},
50+
ctaLabel: "Connect to app",
51+
},
52+
}
53+
54+
export const SliderConnected: Story = {
55+
args: {
56+
nav: {
57+
...meta.args.nav,
58+
step: 3,
59+
},
60+
ctaLabel: "Go to account",
61+
},
62+
}

src/components/Simulator/screens/ConnectWeb3/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export const ConnectWeb3 = ({ nav, ctaLabel }: PhoneScreenProps) => {
128128
style={{ height: "100%" }}
129129
>
130130
<Web3App
131-
bg="background.base"
131+
className="bg-background"
132132
appName="NFT Marketplace"
133133
displayUrl="app.example.com"
134134
>

0 commit comments

Comments
 (0)