|
| 1 | +import pickBy from "lodash/pickBy" |
| 2 | +import type { Meta, StoryObj } from "@storybook/react/*" |
| 3 | + |
| 4 | +import type { List as ButtonDropdownList } from "@/components/ButtonDropdown" |
| 5 | + |
| 6 | +import { viewportModes } from "../../../.storybook/modes" |
| 7 | + |
| 8 | +import MdComponentSet from "." |
| 9 | + |
| 10 | +const meta = { |
| 11 | + title: "Molecules / Display Content / MdComponents", |
| 12 | + parameters: { |
| 13 | + layout: "none", |
| 14 | + chromatic: { |
| 15 | + modes: pickBy(viewportModes, (args) => |
| 16 | + ["md", "lg"].includes(args.viewport) |
| 17 | + ), |
| 18 | + }, |
| 19 | + }, |
| 20 | +} satisfies Meta |
| 21 | + |
| 22 | +export default meta |
| 23 | + |
| 24 | +const { |
| 25 | + ContentContainer, |
| 26 | + h1: Heading1, |
| 27 | + h2: Heading2, |
| 28 | + h3: Heading3, |
| 29 | + h4: Heading4, |
| 30 | + Title, |
| 31 | + p: Paragraph, |
| 32 | + FeaturedText, |
| 33 | + Divider, |
| 34 | + hr: HR, |
| 35 | + pre: Pre, |
| 36 | + Page, |
| 37 | + MobileButton, |
| 38 | + MobileButtonDropdown, |
| 39 | +} = MdComponentSet |
| 40 | + |
| 41 | +const Para = () => ( |
| 42 | + <Paragraph> |
| 43 | + Ether (also known by its ticker symbol, ETH) is the native currency |
| 44 | + transacted on Ethereum. ETH is needed to pay for usage of the Ethereum |
| 45 | + network (in the form of transaction fees). ETH is also used to secure the |
| 46 | + network with staking. When people talk about the price of Ethereum, |
| 47 | + they're referring to ETH the asset. |
| 48 | + </Paragraph> |
| 49 | +) |
| 50 | + |
| 51 | +export const MdComponents: StoryObj = { |
| 52 | + render: () => ( |
| 53 | + <div className="mx-auto max-w-screen-lg"> |
| 54 | + <Page> |
| 55 | + <ContentContainer> |
| 56 | + <MobileButton> |
| 57 | + <MobileButtonDropdown list={roadmapDropdownLinks} /> |
| 58 | + </MobileButton> |
| 59 | + <Heading1>Heading1</Heading1> |
| 60 | + <Para /> |
| 61 | + <Heading2>Heading2</Heading2> |
| 62 | + <Para /> |
| 63 | + <Heading3>Heading3</Heading3> |
| 64 | + <Para /> |
| 65 | + <Heading4>Heading4</Heading4> |
| 66 | + <Para /> |
| 67 | + <Title>Title</Title> |
| 68 | + <Para /> |
| 69 | + <Divider /> |
| 70 | + <Pre>Lots of coding here</Pre> |
| 71 | + <HR /> |
| 72 | + <FeaturedText>Feature Text</FeaturedText> |
| 73 | + </ContentContainer> |
| 74 | + </Page> |
| 75 | + </div> |
| 76 | + ), |
| 77 | +} |
| 78 | + |
| 79 | +const roadmapDropdownLinks: ButtonDropdownList = { |
| 80 | + text: "nav-roadmap-options", |
| 81 | + ariaLabel: "nav-roadmap-options-alt", |
| 82 | + items: [ |
| 83 | + { |
| 84 | + text: "nav-roadmap-home", |
| 85 | + href: "/roadmap/", |
| 86 | + matomo: { |
| 87 | + eventCategory: `Roadmap dropdown`, |
| 88 | + eventAction: `Clicked`, |
| 89 | + eventName: "clicked roadmap home", |
| 90 | + }, |
| 91 | + }, |
| 92 | + { |
| 93 | + text: "nav-roadmap-security", |
| 94 | + href: "/roadmap/security", |
| 95 | + matomo: { |
| 96 | + eventCategory: `Roadmap security dropdown`, |
| 97 | + eventAction: `Clicked`, |
| 98 | + eventName: "clicked roadmap security", |
| 99 | + }, |
| 100 | + }, |
| 101 | + { |
| 102 | + text: "nav-roadmap-scaling", |
| 103 | + href: "/roadmap/scaling", |
| 104 | + matomo: { |
| 105 | + eventCategory: `Roadmap scaling dropdown`, |
| 106 | + eventAction: `Clicked`, |
| 107 | + eventName: "clicked roadmap scaling home", |
| 108 | + }, |
| 109 | + }, |
| 110 | + { |
| 111 | + text: "nav-roadmap-user-experience", |
| 112 | + href: "/roadmap/user-experience/", |
| 113 | + matomo: { |
| 114 | + eventCategory: `Roadmap user experience dropdown`, |
| 115 | + eventAction: `Clicked`, |
| 116 | + eventName: "clicked roadmap user experience home", |
| 117 | + }, |
| 118 | + }, |
| 119 | + { |
| 120 | + text: "nav-roadmap-future-proofing", |
| 121 | + href: "/roadmap/future-proofing", |
| 122 | + matomo: { |
| 123 | + eventCategory: `Roadmap future-proofing dropdown`, |
| 124 | + eventAction: `Clicked`, |
| 125 | + eventName: "clicked roadmap future-proofing home", |
| 126 | + }, |
| 127 | + }, |
| 128 | + ], |
| 129 | +} |
0 commit comments