Skip to content

Commit 81e45fe

Browse files
authored
Merge pull request #13816 from ethereum/bento-arrangement
Update homepage bento arrangement
2 parents df87cb8 + d4b036c commit 81e45fe

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

src/components/Homepage/useBentoBox.ts

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ import MergeImage from "@/public/images/upgrades/merge.png"
1111
type Breakpoint = "mobile" | "lg" | "xl"
1212
type Direction = "down" | "up" | "right" | "left"
1313
type Color = "primary" | "accent-a" | "accent-b" | "accent-c"
14+
type Category = "stablecoins" | "defi" | "dapps" | "networks" | "assets"
15+
type CopyDetails = {
16+
title: string
17+
children: string
18+
action: string
19+
href: string
20+
}
1421

1522
const gradientStops = "from-20% to-60%"
1623

@@ -88,47 +95,39 @@ const getPosition = (position: number): string =>
8895
export const useBentoBox = () => {
8996
const { t } = useTranslation("page-index")
9097

98+
const getCopy = (category: Category, href: string): CopyDetails => ({
99+
title: t(`page-index:page-index-bento-${category}-title`),
100+
children: t(`page-index:page-index-bento-${category}-content`),
101+
action: t(`page-index:page-index-bento-${category}-action`),
102+
href,
103+
})
104+
91105
return [
92106
{
93-
title: t("page-index-bento-stablecoins-title"),
94-
children: t("page-index:page-index-bento-stablecoins-content"),
95-
action: t("page-index:page-index-bento-stablecoins-action"),
96-
href: "/stablecoins/",
97-
imgSrc: ImpactImage,
98-
imgWidth: 400,
107+
...getCopy("stablecoins", "/stablecoins/"),
108+
imgSrc: ManAndDogImage,
99109
className: cn(colorOptions["primary"], getPosition(0)),
100110
},
101111
{
102-
title: t("page-index:page-index-bento-defi-title"),
103-
children: t("page-index:page-index-bento-defi-content"),
104-
action: t("page-index:page-index-bento-defi-action"),
105-
href: "/defi/",
106-
imgSrc: ManAndDogImage,
112+
...getCopy("defi", "/defi/"),
113+
imgSrc: ImpactImage,
114+
imgWidth: 400,
107115
className: cn(colorOptions["accent-c"], getPosition(1)),
108116
},
109117
{
110-
title: t("page-index:page-index-bento-dapps-title"),
111-
children: t("page-index:page-index-bento-dapps-content"),
112-
action: t("page-index:page-index-bento-dapps-action"),
113-
href: "/dapps/",
118+
...getCopy("networks", "/layer-2/"),
114119
imgSrc: MergeImage,
115120
imgWidth: 320,
116121
className: cn(colorOptions["accent-b"], getPosition(2)),
117122
},
118123
{
119-
title: t("page-index:page-index-bento-networks-title"),
120-
children: t("page-index:page-index-bento-networks-content"),
121-
action: t("page-index:page-index-bento-networks-action"),
122-
href: "/layer-2/",
124+
...getCopy("dapps", "/dapps/"),
123125
imgSrc: ManBabyWomanImage,
124126
imgWidth: 324,
125127
className: cn(colorOptions["accent-a"], getPosition(3)),
126128
},
127129
{
128-
title: t("page-index:page-index-bento-assets-title"),
129-
children: t("page-index:page-index-bento-assets-content"),
130-
action: t("page-index:page-index-bento-assets-action"),
131-
href: "/nft/",
130+
...getCopy("assets", "/nft/"),
132131
imgSrc: RobotBarImage,
133132
imgWidth: 324,
134133
className: cn(colorOptions["primary"], getPosition(4)),

0 commit comments

Comments
 (0)