@@ -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
@@ -23,11 +24,12 @@ import { GITHUB_REPO_URL } from "@/lib/constants"
23
24
import { useActiveHash } from "@/hooks/useActiveHash"
24
25
import { useTranslation } from "@/hooks/useTranslation"
25
26
import heroImg from "@/public/images/heroes/guides-hub-hero.jpg"
26
-
27
27
interface ResourcesPageProps {
28
28
txCostsMedianUsd : MetricReturnData
29
29
}
30
30
31
+ const EVENT_CATEGORY = "dashboard"
32
+
31
33
const ResourcesPage = ( { txCostsMedianUsd } : ResourcesPageProps ) => {
32
34
const { t } = useTranslation ( "page-resources" )
33
35
const resourceSections = useResources ( { txCostsMedianUsd } )
@@ -46,6 +48,11 @@ const ResourcesPage = ({ txCostsMedianUsd }: ResourcesPageProps) => {
46
48
GITHUB_REPO_URL
47
49
) . toString ( ) }
48
50
className = "visited:text-white"
51
+ customEventOptions = { {
52
+ eventCategory : EVENT_CATEGORY ,
53
+ eventAction : "links" ,
54
+ eventName : "Ethereum.org Github Page Feedback" ,
55
+ } }
49
56
>
50
57
{ t ( "page-resources-share-feedback" ) }
51
58
</ Link >
@@ -57,112 +64,146 @@ const ResourcesPage = ({ txCostsMedianUsd }: ResourcesPageProps) => {
57
64
description = { t ( "page-resources-hero-description" ) }
58
65
heroImg = { heroImg }
59
66
/>
60
-
61
- < div className = "sticky top-1 my-8 flex flex-col items-center gap-3 py-4 text-center md:top-6 md:px-2" >
62
- < div className = "my-2 text-body-medium" >
63
- { t ( "page-resources-whats-on-this-page" ) }
64
- </ div >
65
- < 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" >
66
- { resourceSections . map ( ( { key, title, icon } ) => (
67
- < ButtonLink
68
- key = { key }
69
- href = { `#${ key } ` }
70
- variant = "ghost"
71
- isSecondary
72
- className = { cn (
73
- "relative text-nowrap rounded-xl px-4 py-2 text-sm [&_svg]:shrink-0 [&_svg]:text-sm" ,
74
- activeSection === key && "!text-primary"
75
- ) }
76
- >
77
- { activeSection === key && (
78
- < motion . div
79
- layoutId = "active-section-highlight"
80
- className = "absolute inset-0 z-0 rounded-xl bg-primary-low-contrast"
81
- />
82
- ) }
83
- { icon && < span className = "z-10 text-lg" > { icon } </ span > }
84
- < span className = "relative z-10" > { title } </ span >
85
- </ ButtonLink >
86
- ) ) }
87
- </ nav >
88
- </ div >
89
-
90
- { resourceSections . map ( ( { key, icon, title : sectionTitle , boxes } ) => (
91
- < section id = { key } key = { key } className = "mb-16 scroll-mt-40" >
92
- < div className = "group flex w-full items-center gap-3 border-b bg-transparent px-4 py-6" >
93
- < div className = "grid size-12 place-items-center rounded-lg border border-border-low-contrast text-2xl [&_svg]:shrink-0" >
94
- { icon || < StackIcon /> }
95
- </ div >
96
- < h2 className = "flex-1 text-start font-black" > { sectionTitle } </ h2 >
67
+ < Stack className = "gap-4 px-2 py-6 md:gap-8 md:px-4 lg:px-8 xl:gap-11" >
68
+ < div className = "sticky top-5 flex flex-col items-center gap-3 text-center md:top-6 md:px-2" >
69
+ < div className = "my-2 text-body-medium" >
70
+ { t ( "page-resources-whats-on-this-page" ) }
97
71
</ div >
98
- < div className = "grid grid-cols-1 gap-8 px-4 pb-12 pt-8 md:pb-12 md:pt-8 lg:grid-cols-2" >
99
- { boxes . map ( ( { title, metric, items, className } ) => (
100
- < div
72
+ < 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" >
73
+ { resourceSections . map ( ( { key, title, icon } ) => (
74
+ < ButtonLink
75
+ key = { key }
76
+ href = { `#${ key } ` }
77
+ variant = "ghost"
78
+ isSecondary
101
79
className = { cn (
102
- "overflow-hidden rounded-2xl border shadow-lg " ,
103
- className
80
+ "relative text-nowrap rounded-xl px-4 py-2 text-sm [&_svg]:shrink-0 [&_svg]:text-sm " ,
81
+ activeSection === key && "!text-primary"
104
82
) }
105
- key = { title }
83
+ customEventOptions = { {
84
+ eventCategory : EVENT_CATEGORY ,
85
+ eventAction : "whats_on_this_page" ,
86
+ eventName : key ,
87
+ } }
106
88
>
107
- < div className = "border-b bg-[#ffffff] px-6 py-4 font-bold dark:bg-[#171717]" >
108
- { title }
89
+ { activeSection === key && (
90
+ < motion . div
91
+ layoutId = "active-section-highlight"
92
+ className = "absolute inset-0 z-0 rounded-xl bg-primary-low-contrast"
93
+ />
94
+ ) }
95
+ { icon && < span className = "z-10 text-lg" > { icon } </ span > }
96
+ < span className = "relative z-10" > { title } </ span >
97
+ </ ButtonLink >
98
+ ) ) }
99
+ </ nav >
100
+ </ div >
101
+ < Stack className = "gap-11 pt-12 md:gap-16 lg:gap-24" >
102
+ { resourceSections . map ( ( { key, icon, title : sectionTitle , boxes } ) => (
103
+ < Stack key = { key } asChild >
104
+ < section id = { key } className = "scroll-mt-40 gap-8 md:gap-6" >
105
+ < div className = "group flex w-full items-center gap-4 border-b bg-transparent px-2 py-4" >
106
+ < div className = "grid size-12 place-items-center rounded-lg border border-border-low-contrast text-2xl [&_svg]:shrink-0" >
107
+ { icon || < StackIcon /> }
108
+ </ div >
109
+ < h2 className = "flex-1 text-start font-black" >
110
+ { sectionTitle }
111
+ </ h2 >
109
112
</ div >
110
- < 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" >
111
- { metric && metric }
112
- < ResourcesContainer >
113
- { items . map ( ( item ) => (
114
- < ResourceItem item = { item } key = { item . title } />
115
- ) ) }
116
- </ ResourcesContainer >
113
+ < div className = "grid grid-cols-1 gap-8 lg:grid-cols-2 lg:gap-y-6" >
114
+ { boxes . map ( ( { title, metric, items, className } ) => (
115
+ < div
116
+ className = { cn (
117
+ "overflow-hidden rounded-2xl border shadow-lg" ,
118
+ className
119
+ ) }
120
+ key = { title }
121
+ >
122
+ < div className = "border-b bg-[#ffffff] px-6 py-4 font-bold dark:bg-[#171717]" >
123
+ { title }
124
+ </ div >
125
+ < 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" >
126
+ { metric && metric }
127
+ < ResourcesContainer >
128
+ { items . map ( ( item ) => (
129
+ < ResourceItem item = { item } key = { item . title } />
130
+ ) ) }
131
+ </ ResourcesContainer >
132
+ </ div >
133
+ </ div >
134
+ ) ) }
117
135
</ div >
118
- </ div >
119
- ) ) }
120
- </ div >
121
- </ section >
122
- ) ) }
123
-
124
- < div className = "mb-20 text-center" >
125
- < Translation id = "page-resources:page-resources-find-more" />
126
- </ div >
136
+ </ section >
137
+ </ Stack >
138
+ ) ) }
139
+ </ Stack >
127
140
128
- < Section
129
- id = "contribute"
130
- className = { cn (
131
- "before:absolute before:-inset-px before:bottom-0 before:z-hide before:rounded-[calc(theme(borderRadius.4xl)+1px)] before:content-['']" , // Border/gradient positioning
132
- "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
133
- "relative inset-0 rounded-4xl bg-background" // Paint background color over card portion
134
- ) }
135
- >
136
- < 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" >
137
- < div className = "flex flex-col gap-y-4 text-center" >
138
- < h2 > { t ( "page-resources-contribute-title" ) } </ h2 >
139
- < p > { t ( "page-resources-contribute-description" ) } </ p >
140
- </ div >
141
- < div className = "mx-auto grid grid-cols-1 gap-16 md:grid-cols-2" >
142
- { /* TODO: Add issue template for resource listing and redirect to new template */ }
143
- < ButtonLink
144
- href = { new URL (
145
- "issues/new?template=feature_request.yaml" ,
146
- GITHUB_REPO_URL
147
- ) . toString ( ) }
148
- variant = "outline"
149
- isSecondary
150
- >
151
- { t ( "page-resources-suggest-resource" ) }
152
- </ ButtonLink >
153
- < ButtonLink
154
- href = { new URL (
155
- "issues/new?template=bug_report.yaml" ,
156
- GITHUB_REPO_URL
157
- ) . toString ( ) }
158
- variant = "outline"
159
- isSecondary
160
- >
161
- < FaGithub /> { t ( "page-resources-found-bug" ) }
162
- </ ButtonLink >
141
+ < VStack className = "gap-4 py-16" >
142
+ < div className = "text-center font-bold" >
143
+ < Translation id = "page-resources:page-resources-find-more" />
163
144
</ div >
164
- </ div >
165
- </ Section >
145
+ < ButtonLink
146
+ href = "https://ethereumdashboards.com"
147
+ size = "lg"
148
+ customEventOptions = { {
149
+ eventCategory : EVENT_CATEGORY ,
150
+ eventAction : "links" ,
151
+ eventName : "ethereumdashboards.com" ,
152
+ } }
153
+ >
154
+ ethereumdashboards.com
155
+ </ ButtonLink >
156
+ </ VStack >
157
+
158
+ < Section
159
+ id = "contribute"
160
+ className = "relative rounded-4xl border border-body/5 bg-background"
161
+ >
162
+ < VStack className = "rounded-4xl bg-radial-a px-4 py-6 md:py-12" >
163
+ < Stack className = "max-w-xl gap-y-10 py-6 lg:max-w-[700px]" >
164
+ < div className = "flex flex-col gap-y-4 text-center" >
165
+ < h2 > { t ( "page-resources-contribute-title" ) } </ h2 >
166
+ < p className = "text-lg" >
167
+ { t ( "page-resources-contribute-description" ) }
168
+ </ p >
169
+ </ div >
170
+ < div className = "mx-auto grid grid-cols-1 gap-x-3 gap-y-4 md:grid-cols-2" >
171
+ { /* TODO: Add issue template for resource listing and redirect to new template */ }
172
+ < ButtonLink
173
+ href = { new URL (
174
+ "issues/new?template=feature_request.yaml" ,
175
+ GITHUB_REPO_URL
176
+ ) . toString ( ) }
177
+ variant = "outline"
178
+ isSecondary
179
+ customEventOptions = { {
180
+ eventCategory : EVENT_CATEGORY ,
181
+ eventAction : "links" ,
182
+ eventName : "Ethereum.org Github Feature Request" ,
183
+ } }
184
+ >
185
+ { t ( "page-resources-suggest-resource" ) }
186
+ </ ButtonLink >
187
+ < ButtonLink
188
+ href = { new URL (
189
+ "issues/new?template=bug_report.yaml" ,
190
+ GITHUB_REPO_URL
191
+ ) . toString ( ) }
192
+ variant = "outline"
193
+ isSecondary
194
+ customEventOptions = { {
195
+ eventCategory : EVENT_CATEGORY ,
196
+ eventAction : "links" ,
197
+ eventName : "Ethereum.org Github Bug Report" ,
198
+ } }
199
+ >
200
+ < FaGithub /> { t ( "page-resources-found-bug" ) }
201
+ </ ButtonLink >
202
+ </ div >
203
+ </ Stack >
204
+ </ VStack >
205
+ </ Section >
206
+ </ Stack >
166
207
</ MainArticle >
167
208
)
168
209
}
0 commit comments