Skip to content

Commit

Permalink
feat(Simulator/screens/ConnectWeb3): create stories for main component
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerAPfledderer committed Feb 6, 2025
1 parent d8c3e2d commit fa74d59
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/components/Simulator/screens/ConnectWeb3/Web3App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { GrMenu } from "react-icons/gr"

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

import { cn } from "@/lib/utils/cn"

import { FAKE_DEMO_ADDRESS } from "../../constants"
import { EthGlyphIcon } from "../../icons"
import { NotificationPopover } from "../../NotificationPopover"
Expand All @@ -15,10 +17,14 @@ export const Web3App = ({
displayUrl,
appName,
children,
className,
...rest
}: Web3AppProps) => {
return (
<div className="size-full bg-background-highlight" {...rest}>
<div
className={cn("size-full bg-background-highlight", className)}
{...rest}
>
<div className="bg-[#e8e8e8] p-1 dark:bg-[#171717]">
<p className="text-center text-xs">{displayUrl}</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import type { Meta, StoryObj } from "@storybook/react/*"
import { fn } from "@storybook/test"

import { Phone } from "@/components/Simulator/Phone"
import { Template } from "@/components/Simulator/Template"

import { ConnectWeb3 as Component } from "../"

const meta = {
title: "Molecules / Display Content / Simulator / ConnectWeb3 Screen",
component: Component,
decorators: [
(Story) => (
<div className="mt-8">
<Template>
<Phone>
<Story />
</Phone>
</Template>
</div>
),
],
args: {
nav: {
progressStepper: fn(),
step: 0,
openPath: fn(),
regressStepper: fn(),
totalSteps: 3,
},
ctaLabel: "Visit NFT market",
},
} satisfies Meta<typeof Component>

export default meta

type Story = StoryObj<typeof meta>

export const Initial: Story = {}

export const SliderNotConnected: Story = {
args: {
nav: {
...meta.args.nav,
step: 2,
},
ctaLabel: "Connect to app",
},
}

export const SliderConnected: Story = {
args: {
nav: {
...meta.args.nav,
step: 3,
},
ctaLabel: "Go to account",
},
}
2 changes: 1 addition & 1 deletion src/components/Simulator/screens/ConnectWeb3/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const ConnectWeb3 = ({ nav, ctaLabel }: PhoneScreenProps) => {
style={{ height: "100%" }}
>
<Web3App
bg="background.base"
className="bg-background"
appName="NFT Marketplace"
displayUrl="app.example.com"
>
Expand Down

0 comments on commit fa74d59

Please sign in to comment.