|
1 |
| -import { useEffect, useState } from "react" |
2 | 1 | import { useTranslation } from "next-i18next"
|
3 | 2 |
|
4 | 3 | import { cn } from "@/lib/utils/cn"
|
5 | 4 |
|
6 |
| -import type { BentoCardProps } from "./BentoCard" |
7 |
| - |
8 | 5 | import ImpactImage from "@/public/images/impact_transparent.png"
|
9 | 6 | import ManAndDogImage from "@/public/images/man-and-dog-playing.png"
|
10 | 7 | import ManBabyWomanImage from "@/public/images/man-baby-woman.png"
|
@@ -90,56 +87,51 @@ const getPosition = (position: number): string =>
|
90 | 87 |
|
91 | 88 | export const useBentoBox = () => {
|
92 | 89 | const { t } = useTranslation("page-index")
|
93 |
| - const [items, setItems] = useState<BentoCardProps[]>([]) |
94 |
| - |
95 |
| - useEffect(() => { |
96 |
| - setItems([ |
97 |
| - { |
98 |
| - title: t("page-index-bento-stablecoins-title"), |
99 |
| - children: t("page-index:page-index-bento-stablecoins-content"), |
100 |
| - action: t("page-index:page-index-bento-stablecoins-action"), |
101 |
| - href: "/stablecoins/", |
102 |
| - imgSrc: ImpactImage, |
103 |
| - imgWidth: 400, |
104 |
| - className: cn(colorOptions["primary"], getPosition(0)), |
105 |
| - }, |
106 |
| - { |
107 |
| - title: t("page-index:page-index-bento-defi-title"), |
108 |
| - children: t("page-index:page-index-bento-defi-content"), |
109 |
| - action: t("page-index:page-index-bento-defi-action"), |
110 |
| - href: "/defi/", |
111 |
| - imgSrc: ManAndDogImage, |
112 |
| - className: cn(colorOptions["accent-c"], getPosition(1)), |
113 |
| - }, |
114 |
| - { |
115 |
| - title: t("page-index:page-index-bento-dapps-title"), |
116 |
| - children: t("page-index:page-index-bento-dapps-content"), |
117 |
| - action: t("page-index:page-index-bento-dapps-action"), |
118 |
| - href: "/dapps/", |
119 |
| - imgSrc: MergeImage, |
120 |
| - imgWidth: 320, |
121 |
| - className: cn(colorOptions["accent-b"], getPosition(2)), |
122 |
| - }, |
123 |
| - { |
124 |
| - title: t("page-index:page-index-bento-networks-title"), |
125 |
| - children: t("page-index:page-index-bento-networks-content"), |
126 |
| - action: t("page-index:page-index-bento-networks-action"), |
127 |
| - href: "/layer-2/", |
128 |
| - imgSrc: ManBabyWomanImage, |
129 |
| - imgWidth: 324, |
130 |
| - className: cn(colorOptions["accent-a"], getPosition(3)), |
131 |
| - }, |
132 |
| - { |
133 |
| - title: t("page-index:page-index-bento-assets-title"), |
134 |
| - children: t("page-index:page-index-bento-assets-content"), |
135 |
| - action: t("page-index:page-index-bento-assets-action"), |
136 |
| - href: "/nft/", |
137 |
| - imgSrc: RobotBarImage, |
138 |
| - imgWidth: 324, |
139 |
| - className: cn(colorOptions["primary"], getPosition(4)), |
140 |
| - }, |
141 |
| - ]) |
142 |
| - }, [t]) |
143 | 90 |
|
144 |
| - return { items } |
| 91 | + return [ |
| 92 | + { |
| 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, |
| 99 | + className: cn(colorOptions["primary"], getPosition(0)), |
| 100 | + }, |
| 101 | + { |
| 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, |
| 107 | + className: cn(colorOptions["accent-c"], getPosition(1)), |
| 108 | + }, |
| 109 | + { |
| 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/", |
| 114 | + imgSrc: MergeImage, |
| 115 | + imgWidth: 320, |
| 116 | + className: cn(colorOptions["accent-b"], getPosition(2)), |
| 117 | + }, |
| 118 | + { |
| 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/", |
| 123 | + imgSrc: ManBabyWomanImage, |
| 124 | + imgWidth: 324, |
| 125 | + className: cn(colorOptions["accent-a"], getPosition(3)), |
| 126 | + }, |
| 127 | + { |
| 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/", |
| 132 | + imgSrc: RobotBarImage, |
| 133 | + imgWidth: 324, |
| 134 | + className: cn(colorOptions["primary"], getPosition(4)), |
| 135 | + }, |
| 136 | + ] |
145 | 137 | }
|
0 commit comments