Skip to content

Commit e290670

Browse files
authored
Merge pull request #10023 from MrJithil/mission-storybook-maximize
Add dismissable banner and icon list stories
2 parents efa7c9b + c194b6f commit e290670

File tree

2 files changed

+236
-0
lines changed

2 files changed

+236
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { Meta, StoryObj } from "@storybook/react"
2+
import React from "react"
3+
import DismissableBanner from "../Banners/DismissableBanner"
4+
5+
export default {
6+
component: DismissableBanner,
7+
} as Meta<typeof DismissableBanner>
8+
9+
/**
10+
* Story taken from DismissableBanner component
11+
*/
12+
const dismissableBannerStoryPageKey = "dismissableBannerStoryPageKey"
13+
const bannerText = "This is a dismissable banner"
14+
15+
export const DismissableBannerStory: StoryObj<typeof DismissableBanner> = {
16+
play: () => {
17+
localStorage.setItem(dismissableBannerStoryPageKey, "false")
18+
},
19+
render: () => {
20+
const children = <div>{bannerText}</div>
21+
return (
22+
<DismissableBanner
23+
children={children}
24+
storageKey={dismissableBannerStoryPageKey}
25+
/>
26+
)
27+
},
28+
}
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
import { Box, Center, StackDivider, VStack } from "@chakra-ui/react"
2+
import { Meta, StoryObj } from "@storybook/react"
3+
import * as React from "react"
4+
import { EthHomeIcon } from "./EthHomeIcon"
5+
import { FeedbackGlyphIcon } from "./FeedbackGlyphIcon"
6+
import { FeedbackThumbsUpIcon } from "./FeedbackThumbsUpIcon"
7+
import { HighlightDarkIcon } from "./HighlightDarkIcon"
8+
import { HighlightIcon } from "./HighlightIcon"
9+
import {
10+
CorrectIcon,
11+
IncorrectIcon,
12+
StarConfettiIcon,
13+
TrophyIcon,
14+
} from "./quiz"
15+
import {
16+
DappnodeIcon,
17+
DecentralizationGlyphIcon,
18+
DecentralizationEthGlyphIcon,
19+
DownloadGlyphIcon,
20+
EarthGlyphIcon,
21+
HardwareGlyphIcon,
22+
MegaphoneGlyphIcon,
23+
PrivacyGlyphIcon,
24+
SovereigntyGlyphIcon,
25+
VoteGlyphIcon,
26+
} from "./run-a-node"
27+
import {
28+
AbyssGlyphIcon,
29+
AnkrGlyphIcon,
30+
AuditedIcon,
31+
AvadoGlyphIcon,
32+
BattleTestedIcon,
33+
BloxstakingGlyphIcon,
34+
BugBountyIcon,
35+
CautionProductGlyphIcon,
36+
StakingDappnodeGlyphIcon,
37+
DefaultOpenSourceGlyphIcon,
38+
DockerGlyphIcon,
39+
EconomicalIcon,
40+
EthpoolGlyphIcon,
41+
GreenCheckProductGlyphIcon,
42+
KilnGlyphIcon,
43+
LidoGlyphIcon,
44+
LiquidityTokenIcon,
45+
MultiClientIcon,
46+
OpenSourceStakingIcon,
47+
PermissionlessIcon,
48+
RocketPoolGlyphIcon,
49+
SelfCustodyIcon,
50+
StafiGlyphIcon,
51+
StakefishGlyphIcon,
52+
StakewiseGlyphIcon,
53+
StakingGlyphCentralizedIcon,
54+
StakingGlyphCloudIcon,
55+
StakingGlyphCPUIcon,
56+
StakingGlyphEtherCircleIcon,
57+
StakingGlyphTokenWalletIcon,
58+
StereumGlyphIcon,
59+
TrustlessIcon,
60+
UnknownProductGlyphIcon,
61+
WagyuGlyphIcon,
62+
WarningProductGlyphIcon,
63+
AllnodesGlyphIcon,
64+
} from "./staking"
65+
import {
66+
BrowserIcon,
67+
BuyCryptoIcon,
68+
ConnectDappsIcon,
69+
DesktopIcon,
70+
EIP1559Icon,
71+
ENSSupportIcon,
72+
ERC20SupportIcon,
73+
FilterBurgerIcon,
74+
FrameIcon,
75+
GasFeeCustomizationIcon,
76+
HardwareIcon,
77+
HardwareSupportIcon,
78+
Layer2Icon,
79+
MobileIcon,
80+
MultisigIcon,
81+
NFTSupportIcon,
82+
NonCustodialIcon,
83+
OpenSourceWalletIcon,
84+
RPCImportingIcon,
85+
SocialRecoverIcon,
86+
StakingIcon,
87+
SwapIcon,
88+
WalletConnectIcon,
89+
WithdrawCryptoIcon,
90+
} from "./wallets"
91+
92+
export default {
93+
component: VStack,
94+
} as Meta<typeof VStack>
95+
96+
const iconsDefinitions = [
97+
CorrectIcon,
98+
IncorrectIcon,
99+
StarConfettiIcon,
100+
TrophyIcon,
101+
DappnodeIcon,
102+
DecentralizationGlyphIcon,
103+
DecentralizationEthGlyphIcon,
104+
DownloadGlyphIcon,
105+
EarthGlyphIcon,
106+
HardwareGlyphIcon,
107+
MegaphoneGlyphIcon,
108+
PrivacyGlyphIcon,
109+
SovereigntyGlyphIcon,
110+
VoteGlyphIcon,
111+
AbyssGlyphIcon,
112+
AllnodesGlyphIcon,
113+
AnkrGlyphIcon,
114+
AuditedIcon,
115+
AvadoGlyphIcon,
116+
BattleTestedIcon,
117+
BloxstakingGlyphIcon,
118+
BugBountyIcon,
119+
CautionProductGlyphIcon,
120+
StakingDappnodeGlyphIcon,
121+
DefaultOpenSourceGlyphIcon,
122+
DockerGlyphIcon,
123+
EconomicalIcon,
124+
EthpoolGlyphIcon,
125+
GreenCheckProductGlyphIcon,
126+
KilnGlyphIcon,
127+
LidoGlyphIcon,
128+
LiquidityTokenIcon,
129+
MultiClientIcon,
130+
OpenSourceStakingIcon,
131+
PermissionlessIcon,
132+
RocketPoolGlyphIcon,
133+
SelfCustodyIcon,
134+
StafiGlyphIcon,
135+
StakefishGlyphIcon,
136+
StakewiseGlyphIcon,
137+
StakingGlyphCentralizedIcon,
138+
StakingGlyphCloudIcon,
139+
StakingGlyphCPUIcon,
140+
StakingGlyphEtherCircleIcon,
141+
StakingGlyphTokenWalletIcon,
142+
StereumGlyphIcon,
143+
TrustlessIcon,
144+
UnknownProductGlyphIcon,
145+
WagyuGlyphIcon,
146+
WarningProductGlyphIcon,
147+
BrowserIcon,
148+
BuyCryptoIcon,
149+
ConnectDappsIcon,
150+
DesktopIcon,
151+
EIP1559Icon,
152+
ENSSupportIcon,
153+
ERC20SupportIcon,
154+
FilterBurgerIcon,
155+
FrameIcon,
156+
GasFeeCustomizationIcon,
157+
HardwareIcon,
158+
HardwareSupportIcon,
159+
Layer2Icon,
160+
MobileIcon,
161+
MultisigIcon,
162+
NFTSupportIcon,
163+
NonCustodialIcon,
164+
OpenSourceWalletIcon,
165+
RPCImportingIcon,
166+
SocialRecoverIcon,
167+
StakingIcon,
168+
SwapIcon,
169+
WalletConnectIcon,
170+
WithdrawCryptoIcon,
171+
EthHomeIcon,
172+
FeedbackGlyphIcon,
173+
FeedbackThumbsUpIcon,
174+
HighlightDarkIcon,
175+
HighlightIcon,
176+
]
177+
178+
iconsDefinitions.sort((a, b) =>
179+
(a?.displayName || "") > (b?.displayName || "") ? 1 : -1
180+
)
181+
const items = iconsDefinitions.map((IconDef) => (
182+
<Box
183+
key={IconDef.displayName}
184+
border="1px"
185+
borderStyle="solid"
186+
borderColor="border"
187+
p={1}
188+
>
189+
<Center>
190+
<IconDef />
191+
</Center>
192+
<Center>{IconDef.displayName}</Center>
193+
</Box>
194+
))
195+
196+
export const IconsList: StoryObj<typeof VStack> = {
197+
render: () => {
198+
return (
199+
<VStack
200+
divider={<StackDivider borderColor="gray.200" />}
201+
spacing={4}
202+
align="stretch"
203+
>
204+
{items}
205+
</VStack>
206+
)
207+
},
208+
}

0 commit comments

Comments
 (0)