Skip to content

feat(storybook): add stories for Brand, ThemeToggle, ConnectWalletButton and StreamTimeline - #1001

Merged
Austinaminu2 merged 2 commits into
FlowwStar:mainfrom
Crypto-Oracle001:feat/storybook-stories-972-975-978-979
Oct 16, 2026
Merged

Austinaminu2 merged 2 commits into
FlowwStar:mainfrom
Crypto-Oracle001:feat/storybook-stories-972-975-978-979

Conversation

@Crypto-Oracle001

Copy link
Copy Markdown

Summary

Adds Storybook stories so these components' states can be reviewed in isolation. Each story file sits next to its component, following components/ui/badge.stories.tsx.

Component Story file States
Brand components/brand.stories.tsx Default, Small
ThemeToggle components/ThemeToggle.stories.tsx Light, Dark
ConnectWalletButton components/layout/connect-wallet-button.stories.tsx Disconnected, Connected, Reconnecting
StreamTimeline components/streams/stream-timeline.stories.tsx Scheduled, Streaming, Completed, Cancelled

Details

  • Brand: uses the real showWordmark prop. Small is the logo mark only.
  • ThemeToggle: wrapped in the real next-themes ThemeProvider with the matching defaultTheme. Each story has its own storage key, cleared in beforeEach, so it always opens in its own theme.
  • ConnectWalletButton: useWallet is mocked per story with a full, type-checked wallet context value. The actions are fn() spies.
  • StreamTimeline: useStreamHistory is mocked with sample on-chain events for each state, rendered inside the real NetworkProvider. Completed has enough events to show the collapse toggle.
  • .storybook/preview.ts: registers sb.mock(import('../hooks/use-wallet.ts'), { spy: true }) and the same for use-stream-history (Storybook 9.1 module mocking). Without an override, the real implementations run. No component or app code changed.

Verification

  • npx tsc --noEmit reports no errors
  • Each listed state has a story
  • All 11 stories render without errors in a built Storybook, checked in headless Chromium

Note: on current main, npm run storybook / storybook build fails for every module with TypeError: swc.isWasm is not a function, before and after this change. Next 16.3.8 doesn't work with the SWC loader in @storybook/nextjs 9.1. These stories were checked with the Babel loader instead. Fixing that tooling issue is out of scope here.

Closes #979
Closes #978
Closes #975
Closes #972

…ton and StreamTimeline

Add Storybook stories so each component's states can be reviewed in
isolation. Stories live next to their components, following the
convention in components/ui/badge.stories.tsx.

Brand (components/brand.stories.tsx)
- Default: logo mark with the FlowStar wordmark
- Small: logo mark only (showWordmark={false})

ThemeToggle (components/ThemeToggle.stories.tsx)
- Light / Dark: wrapped in the real next-themes ThemeProvider with the
  matching defaultTheme. Each story uses its own storage key, cleared in
  beforeEach, so it always opens in its own theme even after the
  toggle has been clicked.

ConnectWalletButton (components/layout/connect-wallet-button.stories.tsx)
- Disconnected, Connected, Reconnecting: useWallet is mocked per story
  with a full, type-checked wallet context value (connect, disconnect
  and signTransaction are storybook/test fn() spies).

StreamTimeline (components/streams/stream-timeline.stories.tsx)
- Scheduled, Streaming, Completed, Cancelled: useStreamHistory is mocked
  with representative on-chain events per state (newest first, as the
  hook returns them), rendered inside the real NetworkProvider. The
  Completed story has enough events to show the collapse toggle.

Storybook config (.storybook/preview.ts)
- Register module mocks for hooks/use-wallet and hooks/use-stream-history
  via sb.mock(..., { spy: true }) (Storybook 9.1). The real
  implementations stay in place unless a story overrides them, and no
  component or app code changes.

Verification
- npx tsc --noEmit reports no errors.
- All 11 stories render without errors in a built Storybook, checked in
  headless Chromium.

Closes FlowwStar#979
Closes FlowwStar#978
Closes FlowwStar#975
Closes FlowwStar#972
@drips-wave

drips-wave Bot commented Oct 16, 2026

Copy link
Copy Markdown

@Crypto-Oracle001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Austinaminu2
Austinaminu2 merged commit 136e2ff into FlowwStar:main Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants