1
+ import { MdInfoOutline } from "react-icons/md"
2
+ import { Box , Icon } from "@chakra-ui/react"
3
+ import { Meta , StoryObj } from "@storybook/react"
4
+
5
+ import { Image } from "@/components/Image"
6
+ import Text from "@/components/OldText"
7
+
8
+ import { getTranslation } from "@/storybook-utils"
9
+
10
+ import { langViewportModes } from "../../../.storybook/modes"
11
+
12
+ import {
13
+ Banner as BannerComponent , BannerBody as BannerBodyComponent ,
14
+ BannerGrid as BannerGridComponent ,
15
+ BannerGridCell as BannerGridCellComponent ,
16
+ BannerImage as BannerImageComponent ,
17
+ } from "."
18
+
19
+ import stats from "@/public/images/upgrades/newrings.png"
20
+
21
+
22
+ const meta = {
23
+ title : "Molecules / Display Content / Banner" ,
24
+ component : BannerComponent ,
25
+ parameters : {
26
+ layout : "fullscreen" ,
27
+ chromatic : {
28
+ modes : {
29
+ ...langViewportModes ,
30
+ } ,
31
+ } ,
32
+ } ,
33
+ decorators : [
34
+ ( Story ) => (
35
+ < Box position = "relative" w = "full" >
36
+ { /* <ContentContainer> */ }
37
+ < Story />
38
+ { /* </ContentContainer> */ }
39
+ </ Box >
40
+ )
41
+ ]
42
+ } satisfies Meta < typeof BannerComponent >
43
+
44
+ export default meta
45
+
46
+ type Story = StoryObj < typeof meta > ;
47
+
48
+ export const Banner : Story = {
49
+ render : ( ) => {
50
+ return (
51
+ < BannerComponent >
52
+ < div > What </ div >
53
+ </ BannerComponent >
54
+ )
55
+ }
56
+ }
57
+
58
+ export const BannerBody : Story = {
59
+ render : ( ) => {
60
+ return (
61
+ < BannerBodyComponent >
62
+ < div > What </ div >
63
+ </ BannerBodyComponent >
64
+ )
65
+ }
66
+ }
67
+
68
+ export const BannerImage : Story = {
69
+ render : ( ) => {
70
+ return (
71
+ < BannerImageComponent >
72
+ < Image src = { stats } alt = "" width = { 400 } />
73
+ </ BannerImageComponent >
74
+ )
75
+ }
76
+ }
77
+
78
+ export const BannerGrid : Story = {
79
+ render : ( ) => {
80
+ const PAGE_WHAT_IS_ETH = "page-what-is-ethereum"
81
+ return (
82
+ < BannerGridComponent >
83
+ { Array . from ( { length : 6 } , ( _ , i ) => i + 1 ) . map ( item => < BannerGridCellComponent key = { item } >
84
+ < Box fontSize = "5xl" mb = { 4 } lineHeight = { 1 } >
85
+ { item } k+
86
+ </ Box >
87
+ < Box fontSize = "md" color = "text200" >
88
+ { getTranslation ( "page-what-is-ethereum-ethereum-in-numbers-stat-1-desc" , PAGE_WHAT_IS_ETH ) }
89
+ < Text as = "span" whiteSpace = "nowrap" >
90
+
91
+ < Box as = "span" >
92
+ < Icon as = { MdInfoOutline } verticalAlign = "middle" />
93
+ </ Box >
94
+ </ Text >
95
+ </ Box >
96
+ </ BannerGridCellComponent > ) }
97
+ </ BannerGridComponent >
98
+ )
99
+ }
100
+ }
0 commit comments