@@ -13,6 +13,7 @@ import { ResourceItem, ResourcesContainer } from "@/components/Resources"
13
13
import { useResources } from "@/components/Resources/useResources"
14
14
import Translation from "@/components/Translation"
15
15
import { ButtonLink } from "@/components/ui/buttons/Button"
16
+ import { Stack , VStack } from "@/components/ui/flex"
16
17
import Link from "@/components/ui/Link"
17
18
import { Section } from "@/components/ui/section"
18
19
@@ -36,6 +37,8 @@ import loadNamespaces from "@/i18n/loadNamespaces"
36
37
import { fetchGrowThePie } from "@/lib/api/fetchGrowThePie"
37
38
import heroImg from "@/public/images/heroes/guides-hub-hero.jpg"
38
39
40
+ const EVENT_CATEGORY = "dashboard"
41
+
39
42
// In seconds
40
43
const REVALIDATE_TIME = BASE_TIME_UNIT * 1
41
44
@@ -103,6 +106,11 @@ const ResourcesPage = ({ txCostsMedianUsd }) => {
103
106
GITHUB_REPO_URL
104
107
) . toString ( ) }
105
108
className = "visited:text-white"
109
+ customEventOptions = { {
110
+ eventCategory : EVENT_CATEGORY ,
111
+ eventAction : "links" ,
112
+ eventName : "Ethereum.org Github Page Feedback" ,
113
+ } }
106
114
>
107
115
{ t ( "page-resources-share-feedback" ) }
108
116
</ Link >
@@ -114,112 +122,146 @@ const ResourcesPage = ({ txCostsMedianUsd }) => {
114
122
description = { t ( "page-resources-hero-description" ) }
115
123
heroImg = { heroImg }
116
124
/>
117
-
118
- < div className = "sticky top-1 my-8 flex flex-col items-center gap-3 py-4 text-center md:top-6 md:px-2" >
119
- < div className = "my-2 text-body-medium" >
120
- { t ( "page-resources-whats-on-this-page" ) }
121
- </ div >
122
- < nav className = "z-sticky mx-4 flex max-w-full gap-1 overflow-x-auto bg-background p-2 shadow md:max-w-[calc(100%-2rem)] md:rounded-2xl md:border md:p-0.5 md:shadow-lg" >
123
- { resourceSections . map ( ( { key, title, icon } ) => (
124
- < ButtonLink
125
- key = { key }
126
- href = { `#${ key } ` }
127
- variant = "ghost"
128
- isSecondary
129
- className = { cn (
130
- "relative text-nowrap rounded-xl px-4 py-2 text-sm [&_svg]:shrink-0 [&_svg]:text-sm" ,
131
- activeSection === key && "!text-primary"
132
- ) }
133
- >
134
- { activeSection === key && (
135
- < motion . div
136
- layoutId = "active-section-highlight"
137
- className = "absolute inset-0 z-0 rounded-xl bg-primary-low-contrast"
138
- />
139
- ) }
140
- { icon && < span className = "z-10 text-lg" > { icon } </ span > }
141
- < span className = "relative z-10" > { title } </ span >
142
- </ ButtonLink >
143
- ) ) }
144
- </ nav >
145
- </ div >
146
-
147
- { resourceSections . map ( ( { key, icon, title : sectionTitle , boxes } ) => (
148
- < section id = { key } key = { key } className = "mb-16 scroll-mt-40" >
149
- < div className = "group flex w-full items-center gap-3 border-b bg-transparent px-4 py-6" >
150
- < div className = "grid size-12 place-items-center rounded-lg border border-border-low-contrast text-2xl [&_svg]:shrink-0" >
151
- { icon || < StackIcon /> }
152
- </ div >
153
- < h2 className = "flex-1 text-start font-black" > { sectionTitle } </ h2 >
125
+ < Stack className = "gap-4 px-2 py-6 md:gap-8 md:px-4 lg:px-8 xl:gap-11" >
126
+ < div className = "sticky top-5 flex flex-col items-center gap-3 text-center md:top-6 md:px-2" >
127
+ < div className = "my-2 text-body-medium" >
128
+ { t ( "page-resources-whats-on-this-page" ) }
154
129
</ div >
155
- < div className = "grid grid-cols-1 gap-8 px-4 pb-12 pt-8 md:pb-12 md:pt-8 lg:grid-cols-2" >
156
- { boxes . map ( ( { title, metric, items, className } ) => (
157
- < div
130
+ < nav className = "z-sticky mx-4 flex max-w-full gap-1 overflow-x-auto bg-background p-2 shadow md:max-w-[calc(100%-2rem)] md:rounded-2xl md:border md:p-0.5 md:shadow-lg" >
131
+ { resourceSections . map ( ( { key, title, icon } ) => (
132
+ < ButtonLink
133
+ key = { key }
134
+ href = { `#${ key } ` }
135
+ variant = "ghost"
136
+ isSecondary
158
137
className = { cn (
159
- "overflow-hidden rounded-2xl border shadow-lg " ,
160
- className
138
+ "relative text-nowrap rounded-xl px-4 py-2 text-sm [&_svg]:shrink-0 [&_svg]:text-sm " ,
139
+ activeSection === key && "!text-primary"
161
140
) }
162
- key = { title }
141
+ customEventOptions = { {
142
+ eventCategory : EVENT_CATEGORY ,
143
+ eventAction : "whats_on_this_page" ,
144
+ eventName : key ,
145
+ } }
163
146
>
164
- < div className = "border-b bg-[#ffffff] px-6 py-4 font-bold dark:bg-[#171717]" >
165
- { title }
147
+ { activeSection === key && (
148
+ < motion . div
149
+ layoutId = "active-section-highlight"
150
+ className = "absolute inset-0 z-0 rounded-xl bg-primary-low-contrast"
151
+ />
152
+ ) }
153
+ { icon && < span className = "z-10 text-lg" > { icon } </ span > }
154
+ < span className = "relative z-10" > { title } </ span >
155
+ </ ButtonLink >
156
+ ) ) }
157
+ </ nav >
158
+ </ div >
159
+ < Stack className = "gap-11 pt-12 md:gap-16 lg:gap-24" >
160
+ { resourceSections . map ( ( { key, icon, title : sectionTitle , boxes } ) => (
161
+ < Stack key = { key } asChild >
162
+ < section id = { key } className = "scroll-mt-40 gap-8 md:gap-6" >
163
+ < div className = "group flex w-full items-center gap-4 border-b bg-transparent px-2 py-4" >
164
+ < div className = "grid size-12 place-items-center rounded-lg border border-border-low-contrast text-2xl [&_svg]:shrink-0" >
165
+ { icon || < StackIcon /> }
166
+ </ div >
167
+ < h2 className = "flex-1 text-start font-black" >
168
+ { sectionTitle }
169
+ </ h2 >
166
170
</ div >
167
- < div className = "h-full bg-background bg-gradient-to-br from-white to-primary/10 px-2 py-6 dark:from-transparent dark:to-primary/10" >
168
- { metric && metric }
169
- < ResourcesContainer >
170
- { items . map ( ( item ) => (
171
- < ResourceItem item = { item } key = { item . title } />
172
- ) ) }
173
- </ ResourcesContainer >
171
+ < div className = "grid grid-cols-1 gap-8 lg:grid-cols-2 lg:gap-y-6" >
172
+ { boxes . map ( ( { title, metric, items, className } ) => (
173
+ < div
174
+ className = { cn (
175
+ "overflow-hidden rounded-2xl border shadow-lg" ,
176
+ className
177
+ ) }
178
+ key = { title }
179
+ >
180
+ < div className = "border-b bg-[#ffffff] px-6 py-4 font-bold dark:bg-[#171717]" >
181
+ { title }
182
+ </ div >
183
+ < div className = "h-full bg-background bg-gradient-to-br from-white to-primary/10 px-2 py-6 dark:from-transparent dark:to-primary/10" >
184
+ { metric && metric }
185
+ < ResourcesContainer >
186
+ { items . map ( ( item ) => (
187
+ < ResourceItem item = { item } key = { item . title } />
188
+ ) ) }
189
+ </ ResourcesContainer >
190
+ </ div >
191
+ </ div >
192
+ ) ) }
174
193
</ div >
175
- </ div >
176
- ) ) }
177
- </ div >
178
- </ section >
179
- ) ) }
180
-
181
- < div className = "mb-20 text-center" >
182
- < Translation id = "page-resources:page-resources-find-more" />
183
- </ div >
184
-
185
- < Section
186
- id = "contribute"
187
- className = { cn (
188
- "before:absolute before:-inset-px before:bottom-0 before:z-hide before:rounded-[calc(theme(borderRadius.4xl)+1px)] before:content-['']" , // Border/gradient positioning
189
- "before:bg-gradient-to-b before:from-primary-hover/[0.24] before:to-primary-hover/[0.08] before:dark:from-primary-hover/40 before:dark:to-primary-hover/20" , // Border/gradient coloring
190
- "relative inset-0 rounded-4xl bg-background" // Paint background color over card portion
191
- ) }
192
- >
193
- < div className = "mb-12 flex flex-col gap-y-8 rounded-4xl bg-radial-a px-8 py-12 lg:mb-32 xl:mb-36" >
194
- < div className = "flex flex-col gap-y-4 text-center" >
195
- < h2 > { t ( "page-resources-contribute-title" ) } </ h2 >
196
- < p > { t ( "page-resources-contribute-description" ) } </ p >
197
- </ div >
198
- < div className = "mx-auto grid grid-cols-1 gap-16 md:grid-cols-2" >
199
- { /* TODO: Add issue template for resource listing and redirect to new template */ }
200
- < ButtonLink
201
- href = { new URL (
202
- "issues/new?template=feature_request.yaml" ,
203
- GITHUB_REPO_URL
204
- ) . toString ( ) }
205
- variant = "outline"
206
- isSecondary
207
- >
208
- { t ( "page-resources-suggest-resource" ) }
209
- </ ButtonLink >
210
- < ButtonLink
211
- href = { new URL (
212
- "issues/new?template=bug_report.yaml" ,
213
- GITHUB_REPO_URL
214
- ) . toString ( ) }
215
- variant = "outline"
216
- isSecondary
217
- >
218
- < FaGithub /> { t ( "page-resources-found-bug" ) }
219
- </ ButtonLink >
194
+ </ section >
195
+ </ Stack >
196
+ ) ) }
197
+ </ Stack >
198
+
199
+ < VStack className = "gap-4 py-16" >
200
+ < div className = "text-center font-bold" >
201
+ < Translation id = "page-resources:page-resources-find-more" />
220
202
</ div >
221
- </ div >
222
- </ Section >
203
+ < ButtonLink
204
+ href = "https://ethereumdashboards.com"
205
+ size = "lg"
206
+ customEventOptions = { {
207
+ eventCategory : EVENT_CATEGORY ,
208
+ eventAction : "links" ,
209
+ eventName : "ethereumdashboards.com" ,
210
+ } }
211
+ >
212
+ ethereumdashboards.com
213
+ </ ButtonLink >
214
+ </ VStack >
215
+
216
+ < Section
217
+ id = "contribute"
218
+ className = "relative rounded-4xl border border-body/5 bg-background"
219
+ >
220
+ < VStack className = "rounded-4xl bg-radial-a px-4 py-6 md:py-12" >
221
+ < Stack className = "max-w-xl gap-y-10 py-6 lg:max-w-[700px]" >
222
+ < div className = "flex flex-col gap-y-4 text-center" >
223
+ < h2 > { t ( "page-resources-contribute-title" ) } </ h2 >
224
+ < p className = "text-lg" >
225
+ { t ( "page-resources-contribute-description" ) }
226
+ </ p >
227
+ </ div >
228
+ < div className = "mx-auto grid grid-cols-1 gap-x-3 gap-y-4 md:grid-cols-2" >
229
+ { /* TODO: Add issue template for resource listing and redirect to new template */ }
230
+ < ButtonLink
231
+ href = { new URL (
232
+ "issues/new?template=feature_request.yaml" ,
233
+ GITHUB_REPO_URL
234
+ ) . toString ( ) }
235
+ variant = "outline"
236
+ isSecondary
237
+ customEventOptions = { {
238
+ eventCategory : EVENT_CATEGORY ,
239
+ eventAction : "links" ,
240
+ eventName : "Ethereum.org Github Feature Request" ,
241
+ } }
242
+ >
243
+ { t ( "page-resources-suggest-resource" ) }
244
+ </ ButtonLink >
245
+ < ButtonLink
246
+ href = { new URL (
247
+ "issues/new?template=bug_report.yaml" ,
248
+ GITHUB_REPO_URL
249
+ ) . toString ( ) }
250
+ variant = "outline"
251
+ isSecondary
252
+ customEventOptions = { {
253
+ eventCategory : EVENT_CATEGORY ,
254
+ eventAction : "links" ,
255
+ eventName : "Ethereum.org Github Bug Report" ,
256
+ } }
257
+ >
258
+ < FaGithub /> { t ( "page-resources-found-bug" ) }
259
+ </ ButtonLink >
260
+ </ div >
261
+ </ Stack >
262
+ </ VStack >
263
+ </ Section >
264
+ </ Stack >
223
265
</ MainArticle >
224
266
)
225
267
}
0 commit comments