Skip to content

Commit 6864cc7

Browse files
committed
chore(banner image): add banner image to banner grid substory
1 parent c35d3c4 commit 6864cc7

File tree

1 file changed

+81
-42
lines changed

1 file changed

+81
-42
lines changed

src/components/BannerGrid/BannerGrid.stories.tsx

Lines changed: 81 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import { Box, Icon } from "@chakra-ui/react"
33
import { Meta, StoryObj } from "@storybook/react"
44

55
import { Image } from "@/components/Image"
6+
import InlineLink from "@/components/Link"
67
import Text from "@/components/OldText"
8+
import Tooltip from "@/components/Tooltip"
79

810
import { getTranslation } from "@/storybook-utils"
911

@@ -46,11 +48,24 @@ export default meta
4648

4749
type Story = StoryObj<typeof meta>
4850

51+
const PAGE_WHAT_IS_ETH = "page-what-is-ethereum"
52+
53+
const tooltipContent = ({ apiUrl, apiProvider, ariaLabel }) => (
54+
<div>
55+
{getTranslation("data-provided-by", "common")}{" "}
56+
<InlineLink href={apiUrl} aria-label={ariaLabel}>
57+
{apiProvider}
58+
</InlineLink>
59+
</div>
60+
)
61+
4962
export const Banner: Story = {
5063
render: () => {
5164
return (
5265
<BannerComponent>
53-
<div>What </div>
66+
<Box fontSize="md" color="text200">
67+
Banner
68+
</Box>
5469
</BannerComponent>
5570
)
5671
},
@@ -61,7 +76,9 @@ export const BannerBody: Story = {
6176
return (
6277
<BannerComponent>
6378
<BannerBodyComponent>
64-
<div>What </div>
79+
<Box fontSize="md" color="text200">
80+
Banner Body
81+
</Box>
6582
</BannerBodyComponent>
6683
</BannerComponent>
6784
)
@@ -82,57 +99,79 @@ export const BannerImage: Story = {
8299

83100
export const BannerGridCell: Story = {
84101
render: () => {
85-
const PAGE_WHAT_IS_ETH = "page-what-is-ethereum"
86102
return (
87103
<BannerComponent>
88-
<BannerGridCellComponent>
89-
<Box fontSize="5xl" mb={4} lineHeight={1}>
90-
4k+
91-
</Box>
92-
<Box fontSize="md" color="text200">
93-
{getTranslation(
94-
"page-what-is-ethereum-ethereum-in-numbers-stat-1-desc",
95-
PAGE_WHAT_IS_ETH
96-
)}
97-
<Text as="span" whiteSpace="nowrap">
98-
&nbsp;
99-
<Box as="span">
100-
<Icon as={MdInfoOutline} verticalAlign="middle" />
101-
</Box>
102-
</Text>
103-
</Box>
104-
</BannerGridCellComponent>
104+
<BannerBodyComponent>
105+
<BannerGridCellComponent>
106+
<Box fontSize="5xl" mb={4} lineHeight={1}>
107+
4k+
108+
</Box>
109+
<Box fontSize="md" color="text200">
110+
{getTranslation(
111+
"page-what-is-ethereum-ethereum-in-numbers-stat-1-desc",
112+
PAGE_WHAT_IS_ETH
113+
)}
114+
<Text as="span" whiteSpace="nowrap">
115+
&nbsp;
116+
<Tooltip
117+
content={tooltipContent({
118+
apiUrl: "https://dappradar.com/rankings/protocol/ethereum",
119+
apiProvider: "State of the dapps",
120+
ariaLabel: "Read more about Ethereum projects stats",
121+
})}
122+
>
123+
<Box as="span">
124+
<Icon as={MdInfoOutline} verticalAlign="middle" />
125+
</Box>
126+
</Tooltip>
127+
</Text>
128+
</Box>
129+
</BannerGridCellComponent>
130+
</BannerBodyComponent>
105131
</BannerComponent>
106132
)
107133
},
108134
}
109135

110136
export const BannerGrid: Story = {
111137
render: () => {
112-
const PAGE_WHAT_IS_ETH = "page-what-is-ethereum"
113138
return (
114139
<BannerComponent>
115-
<BannerGridComponent>
116-
{Array.from({ length: 6 }, (_, i) => i + 1).map((item) => (
117-
<BannerGridCellComponent key={item}>
118-
<Box fontSize="5xl" mb={4} lineHeight={1}>
119-
{item}k+
120-
</Box>
121-
<Box fontSize="md" color="text200">
122-
{getTranslation(
123-
"page-what-is-ethereum-ethereum-in-numbers-stat-1-desc",
124-
PAGE_WHAT_IS_ETH
125-
)}
126-
<Text as="span" whiteSpace="nowrap">
127-
&nbsp;
128-
<Box as="span">
129-
<Icon as={MdInfoOutline} verticalAlign="middle" />
130-
</Box>
131-
</Text>
132-
</Box>
133-
</BannerGridCellComponent>
134-
))}
135-
</BannerGridComponent>
140+
<BannerBodyComponent>
141+
<BannerGridComponent>
142+
{Array.from({ length: 6 }, (_, i) => i + 1).map((item) => (
143+
<BannerGridCellComponent key={item}>
144+
<Box fontSize="5xl" mb={4} lineHeight={1}>
145+
{item}k+
146+
</Box>
147+
<Box fontSize="md" color="text200">
148+
{getTranslation(
149+
"page-what-is-ethereum-ethereum-in-numbers-stat-1-desc",
150+
PAGE_WHAT_IS_ETH
151+
)}
152+
<Text as="span" whiteSpace="nowrap">
153+
&nbsp;
154+
<Tooltip
155+
content={tooltipContent({
156+
apiUrl:
157+
"https://dappradar.com/rankings/protocol/ethereum",
158+
apiProvider: "State of the dapps",
159+
ariaLabel: "Read more about Ethereum projects stats",
160+
})}
161+
>
162+
<Box as="span">
163+
<Icon as={MdInfoOutline} verticalAlign="middle" />
164+
</Box>
165+
</Tooltip>
166+
</Text>
167+
</Box>
168+
</BannerGridCellComponent>
169+
))}
170+
</BannerGridComponent>
171+
</BannerBodyComponent>
172+
<BannerImageComponent>
173+
<Image src={stats} alt="" width={400} />
174+
</BannerImageComponent>
136175
</BannerComponent>
137176
)
138177
},

0 commit comments

Comments
 (0)