From 48139e74338dbe9fb6d412d01a78d5bbe2e38bb7 Mon Sep 17 00:00:00 2001 From: tylerapfledderer Date: Tue, 25 Mar 2025 10:41:45 -0400 Subject: [PATCH 1/8] refactor(resources): add wrapper around main content --- src/pages/[locale]/resources.tsx | 202 ++++++++++++++++--------------- 1 file changed, 102 insertions(+), 100 deletions(-) diff --git a/src/pages/[locale]/resources.tsx b/src/pages/[locale]/resources.tsx index 129e12ae176..310f98cdf05 100644 --- a/src/pages/[locale]/resources.tsx +++ b/src/pages/[locale]/resources.tsx @@ -13,6 +13,7 @@ import { ResourceItem, ResourcesContainer } from "@/components/Resources" import { useResources } from "@/components/Resources/useResources" import Translation from "@/components/Translation" import { ButtonLink } from "@/components/ui/buttons/Button" +import { Stack } from "@/components/ui/flex" import Link from "@/components/ui/Link" import { Section } from "@/components/ui/section" @@ -114,112 +115,113 @@ const ResourcesPage = ({ txCostsMedianUsd }) => { description={t("page-resources-hero-description")} heroImg={heroImg} /> - -
-
- {t("page-resources-whats-on-this-page")} -
- -
- - {resourceSections.map(({ key, icon, title: sectionTitle, boxes }) => ( -
-
-
- {icon || } -
-

{sectionTitle}

+ +
+
+ {t("page-resources-whats-on-this-page")}
-
- {boxes.map(({ title, metric, items, className }) => ( -
+ {resourceSections.map(({ key, title, icon }) => ( + -
- {title} -
-
- {metric && metric} - - {items.map((item) => ( - - ))} - -
-
+ {activeSection === key && ( + + )} + {icon && {icon}} + {title} + ))} -
-
- ))} - -
- -
- -
-
-
-

{t("page-resources-contribute-title")}

-

{t("page-resources-contribute-description")}

-
-
- {/* TODO: Add issue template for resource listing and redirect to new template */} - - {t("page-resources-suggest-resource")} - - - {t("page-resources-found-bug")} - -
+ +
+ + {resourceSections.map(({ key, icon, title: sectionTitle, boxes }) => ( +
+
+
+ {icon || } +
+

{sectionTitle}

+
+
+ {boxes.map(({ title, metric, items, className }) => ( +
+
+ {title} +
+
+ {metric && metric} + + {items.map((item) => ( + + ))} + +
+
+ ))} +
+
+ ))} + +
+
-
+ +
+
+
+

{t("page-resources-contribute-title")}

+

{t("page-resources-contribute-description")}

+
+
+ {/* TODO: Add issue template for resource listing and redirect to new template */} + + {t("page-resources-suggest-resource")} + + + {t("page-resources-found-bug")} + +
+
+
+ ) } From e95c61834754b9e1d6fe67af73ea9139e27671a9 Mon Sep 17 00:00:00 2001 From: tylerapfledderer Date: Tue, 25 Mar 2025 23:57:40 -0400 Subject: [PATCH 2/8] refactor(resources): remove padding and margin from sub nav section --- src/pages/[locale]/resources.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/[locale]/resources.tsx b/src/pages/[locale]/resources.tsx index 310f98cdf05..2d2836bd028 100644 --- a/src/pages/[locale]/resources.tsx +++ b/src/pages/[locale]/resources.tsx @@ -116,7 +116,7 @@ const ResourcesPage = ({ txCostsMedianUsd }) => { heroImg={heroImg} /> -
+
{t("page-resources-whats-on-this-page")}
From c5154eaca03d679972b1012d138cfdd82ab11853 Mon Sep 17 00:00:00 2001 From: tylerapfledderer Date: Wed, 26 Mar 2025 00:40:29 -0400 Subject: [PATCH 3/8] refactor(resources): update spacing for section cards --- src/pages/[locale]/resources.tsx | 69 +++++++++++++++++--------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/src/pages/[locale]/resources.tsx b/src/pages/[locale]/resources.tsx index 2d2836bd028..6ce0aa5b976 100644 --- a/src/pages/[locale]/resources.tsx +++ b/src/pages/[locale]/resources.tsx @@ -144,40 +144,45 @@ const ResourcesPage = ({ txCostsMedianUsd }) => { ))}
- - {resourceSections.map(({ key, icon, title: sectionTitle, boxes }) => ( -
-
-
- {icon || } -
-

{sectionTitle}

-
-
- {boxes.map(({ title, metric, items, className }) => ( -
-
- {title} -
-
- {metric && metric} - - {items.map((item) => ( - - ))} - + + {resourceSections.map(({ key, icon, title: sectionTitle, boxes }) => ( + +
+
+
+ {icon || }
+

+ {sectionTitle} +

- ))} -
-
- ))} +
+ {boxes.map(({ title, metric, items, className }) => ( +
+
+ {title} +
+
+ {metric && metric} + + {items.map((item) => ( + + ))} + +
+
+ ))} +
+ + + ))} +
From 717ebfc329487490080b3a7d511881b9011f0e43 Mon Sep 17 00:00:00 2001 From: tylerapfledderer Date: Wed, 26 Mar 2025 11:09:49 -0400 Subject: [PATCH 4/8] refactor(resources): update spacing and content style for more resources section --- src/intl/en/page-resources.json | 4 ++-- src/pages/[locale]/resources.tsx | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/intl/en/page-resources.json b/src/intl/en/page-resources.json index 73a60e98b3d..76f93344139 100644 --- a/src/intl/en/page-resources.json +++ b/src/intl/en/page-resources.json @@ -76,7 +76,7 @@ "page-resources-hero-title": "Resources", "page-resources-hero-header": "Ethereum Dashboards", "page-resources-hero-description": "Discover a list of community-curated resources to stay updated on all major Ethereum ecosystem developments.", - "page-resources-find-more": "Find more great resources on ethereumdashboards.com", + "page-resources-find-more": "Find more great resources on", "page-resources-contribute-title": "Contribute", "page-resources-contribute-description": "This dashboard is a living page that requires frequent updates. Help find the best resources to give an overview of the Ethereum ecosystem.", "page-resources-suggest-resource": "Suggest a resource", @@ -84,4 +84,4 @@ "page-resources-whats-on-this-page": "What's on this page", "page-resources-banner-notification-message": "Resources dashboard is new!", "page-resources-share-feedback": "Please share your feedback with us" -} +} \ No newline at end of file diff --git a/src/pages/[locale]/resources.tsx b/src/pages/[locale]/resources.tsx index 6ce0aa5b976..bf5fadbb5d5 100644 --- a/src/pages/[locale]/resources.tsx +++ b/src/pages/[locale]/resources.tsx @@ -13,7 +13,7 @@ import { ResourceItem, ResourcesContainer } from "@/components/Resources" import { useResources } from "@/components/Resources/useResources" import Translation from "@/components/Translation" import { ButtonLink } from "@/components/ui/buttons/Button" -import { Stack } from "@/components/ui/flex" +import { Stack, VStack } from "@/components/ui/flex" import Link from "@/components/ui/Link" import { Section } from "@/components/ui/section" @@ -184,9 +184,14 @@ const ResourcesPage = ({ txCostsMedianUsd }) => { ))} -
- -
+ +
+ +
+ + ethereumdashboards.com + +
Date: Wed, 26 Mar 2025 22:47:37 -0400 Subject: [PATCH 5/8] refactor(resources): update spacing for contribute section --- src/pages/[locale]/resources.tsx | 68 ++++++++++++++++---------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/pages/[locale]/resources.tsx b/src/pages/[locale]/resources.tsx index bf5fadbb5d5..7389302a6a2 100644 --- a/src/pages/[locale]/resources.tsx +++ b/src/pages/[locale]/resources.tsx @@ -195,41 +195,41 @@ const ResourcesPage = ({ txCostsMedianUsd }) => {
-
-
-

{t("page-resources-contribute-title")}

-

{t("page-resources-contribute-description")}

-
-
- {/* TODO: Add issue template for resource listing and redirect to new template */} - - {t("page-resources-suggest-resource")} - - - {t("page-resources-found-bug")} - -
-
+ + +
+

{t("page-resources-contribute-title")}

+

+ {t("page-resources-contribute-description")} +

+
+
+ {/* TODO: Add issue template for resource listing and redirect to new template */} + + {t("page-resources-suggest-resource")} + + + {t("page-resources-found-bug")} + +
+
+
From 246fba6eac7dd91d1b48940b943b492126afe0e5 Mon Sep 17 00:00:00 2001 From: tylerapfledderer Date: Wed, 26 Mar 2025 22:52:49 -0400 Subject: [PATCH 6/8] refactor(resource): increase vertical padding for main content wrapper --- src/pages/[locale]/resources.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/[locale]/resources.tsx b/src/pages/[locale]/resources.tsx index 7389302a6a2..90f31d279c7 100644 --- a/src/pages/[locale]/resources.tsx +++ b/src/pages/[locale]/resources.tsx @@ -115,7 +115,7 @@ const ResourcesPage = ({ txCostsMedianUsd }) => { description={t("page-resources-hero-description")} heroImg={heroImg} /> - +
{t("page-resources-whats-on-this-page")} From ae0d0835e0c7c8681df23dc7c98da5977932248b Mon Sep 17 00:00:00 2001 From: tylerapfledderer Date: Thu, 27 Mar 2025 09:17:11 -0400 Subject: [PATCH 7/8] feat(resources): add event tracking --- src/pages/[locale]/index.tsx | 7 +++++ src/pages/[locale]/resources.tsx | 44 +++++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/src/pages/[locale]/index.tsx b/src/pages/[locale]/index.tsx index fa7033af847..9b42be29766 100644 --- a/src/pages/[locale]/index.tsx +++ b/src/pages/[locale]/index.tsx @@ -371,6 +371,13 @@ const HomePage = ({ href="/resources/" isSecondary variant="outline" + onClick={() => + trackCustomEvent({ + eventCategory, + eventAction: "ethereum_activity", + eventName: "ethereum_activity", + }) + } > {t("page-index:page-index-activity-action")} diff --git a/src/pages/[locale]/resources.tsx b/src/pages/[locale]/resources.tsx index 90f31d279c7..ecc5f083944 100644 --- a/src/pages/[locale]/resources.tsx +++ b/src/pages/[locale]/resources.tsx @@ -21,6 +21,7 @@ import { cn } from "@/lib/utils/cn" import { dataLoader } from "@/lib/utils/data/dataLoader" import { existsNamespace } from "@/lib/utils/existsNamespace" import { getLastDeployDate } from "@/lib/utils/getLastDeployDate" +import { trackCustomEvent } from "@/lib/utils/matomo" import { getLocaleTimestamp } from "@/lib/utils/time" import { getRequiredNamespacesForPage } from "@/lib/utils/translations" @@ -37,6 +38,8 @@ import loadNamespaces from "@/i18n/loadNamespaces" import { fetchGrowThePie } from "@/lib/api/fetchGrowThePie" import heroImg from "@/public/images/heroes/guides-hub-hero.jpg" +const EVENT_CATEGORY = "dashboard" + // In seconds const REVALIDATE_TIME = BASE_TIME_UNIT * 1 @@ -104,6 +107,13 @@ const ResourcesPage = ({ txCostsMedianUsd }) => { GITHUB_REPO_URL ).toString()} className="visited:text-white" + onClick={() => { + trackCustomEvent({ + eventCategory: EVENT_CATEGORY, + eventAction: "links", + eventName: "Ethereum.org Github Page Feedback", + }) + }} > {t("page-resources-share-feedback")} @@ -131,6 +141,14 @@ const ResourcesPage = ({ txCostsMedianUsd }) => { "relative text-nowrap rounded-xl px-4 py-2 text-sm [&_svg]:shrink-0 [&_svg]:text-sm", activeSection === key && "!text-primary" )} + onClick={() => + trackCustomEvent({ + eventCategory: EVENT_CATEGORY, + eventAction: "whats_on_this_page", + eventName: + "network,using, scaling, resilience, privacy_security", + }) + } > {activeSection === key && ( {
- + { + trackCustomEvent({ + eventCategory: EVENT_CATEGORY, + eventAction: "links", + eventName: "ethereumdashboards.com", + }) + }} + > ethereumdashboards.com @@ -214,6 +242,13 @@ const ResourcesPage = ({ txCostsMedianUsd }) => { ).toString()} variant="outline" isSecondary + onClick={() => { + trackCustomEvent({ + eventCategory: EVENT_CATEGORY, + eventAction: "links", + eventName: "Ethereum.org Github Feature Request", + }) + }} > {t("page-resources-suggest-resource")} @@ -224,6 +259,13 @@ const ResourcesPage = ({ txCostsMedianUsd }) => { ).toString()} variant="outline" isSecondary + onClick={() => { + trackCustomEvent({ + eventCategory: EVENT_CATEGORY, + eventAction: "links", + eventName: "Ethereum.org Github Bug Report", + }) + }} > {t("page-resources-found-bug")} From 686c45a1a348c9bf6f7a1638a9d3c59f96c1f376 Mon Sep 17 00:00:00 2001 From: Corwin Smith Date: Thu, 10 Apr 2025 11:37:24 -0600 Subject: [PATCH 8/8] matomo events --- src/components/Resources/index.tsx | 5 +++ src/pages/[locale]/index.tsx | 12 +++---- src/pages/[locale]/resources.tsx | 54 ++++++++++++------------------ 3 files changed, 31 insertions(+), 40 deletions(-) diff --git a/src/components/Resources/index.tsx b/src/components/Resources/index.tsx index ca6d46323e0..ac94a5202af 100644 --- a/src/components/Resources/index.tsx +++ b/src/components/Resources/index.tsx @@ -31,6 +31,11 @@ export const ResourceItem = ({ "flex gap-2 border-b p-3 text-body no-underline last-of-type:border-0 hover:bg-background-highlight hover:text-body", className )} + customEventOptions={{ + eventCategory: "dashboard", + eventAction: "links", + eventName: title, + }} hideArrow >
diff --git a/src/pages/[locale]/index.tsx b/src/pages/[locale]/index.tsx index 9b42be29766..4c258ef3569 100644 --- a/src/pages/[locale]/index.tsx +++ b/src/pages/[locale]/index.tsx @@ -371,13 +371,11 @@ const HomePage = ({ href="/resources/" isSecondary variant="outline" - onClick={() => - trackCustomEvent({ - eventCategory, - eventAction: "ethereum_activity", - eventName: "ethereum_activity", - }) - } + customEventOptions={{ + eventCategory: eventCategory, + eventAction: "ethereum_activity", + eventName: "ethereum_activity", + }} > {t("page-index:page-index-activity-action")} diff --git a/src/pages/[locale]/resources.tsx b/src/pages/[locale]/resources.tsx index ecc5f083944..c4f5462cd07 100644 --- a/src/pages/[locale]/resources.tsx +++ b/src/pages/[locale]/resources.tsx @@ -21,7 +21,6 @@ import { cn } from "@/lib/utils/cn" import { dataLoader } from "@/lib/utils/data/dataLoader" import { existsNamespace } from "@/lib/utils/existsNamespace" import { getLastDeployDate } from "@/lib/utils/getLastDeployDate" -import { trackCustomEvent } from "@/lib/utils/matomo" import { getLocaleTimestamp } from "@/lib/utils/time" import { getRequiredNamespacesForPage } from "@/lib/utils/translations" @@ -107,12 +106,10 @@ const ResourcesPage = ({ txCostsMedianUsd }) => { GITHUB_REPO_URL ).toString()} className="visited:text-white" - onClick={() => { - trackCustomEvent({ - eventCategory: EVENT_CATEGORY, - eventAction: "links", - eventName: "Ethereum.org Github Page Feedback", - }) + customEventOptions={{ + eventCategory: EVENT_CATEGORY, + eventAction: "links", + eventName: "Ethereum.org Github Page Feedback", }} > {t("page-resources-share-feedback")} @@ -141,14 +138,11 @@ const ResourcesPage = ({ txCostsMedianUsd }) => { "relative text-nowrap rounded-xl px-4 py-2 text-sm [&_svg]:shrink-0 [&_svg]:text-sm", activeSection === key && "!text-primary" )} - onClick={() => - trackCustomEvent({ - eventCategory: EVENT_CATEGORY, - eventAction: "whats_on_this_page", - eventName: - "network,using, scaling, resilience, privacy_security", - }) - } + customEventOptions={{ + eventCategory: EVENT_CATEGORY, + eventAction: "whats_on_this_page", + eventName: key, + }} > {activeSection === key && ( { { - trackCustomEvent({ - eventCategory: EVENT_CATEGORY, - eventAction: "links", - eventName: "ethereumdashboards.com", - }) + customEventOptions={{ + eventCategory: EVENT_CATEGORY, + eventAction: "links", + eventName: "ethereumdashboards.com", }} > ethereumdashboards.com @@ -242,12 +234,10 @@ const ResourcesPage = ({ txCostsMedianUsd }) => { ).toString()} variant="outline" isSecondary - onClick={() => { - trackCustomEvent({ - eventCategory: EVENT_CATEGORY, - eventAction: "links", - eventName: "Ethereum.org Github Feature Request", - }) + customEventOptions={{ + eventCategory: EVENT_CATEGORY, + eventAction: "links", + eventName: "Ethereum.org Github Feature Request", }} > {t("page-resources-suggest-resource")} @@ -259,12 +249,10 @@ const ResourcesPage = ({ txCostsMedianUsd }) => { ).toString()} variant="outline" isSecondary - onClick={() => { - trackCustomEvent({ - eventCategory: EVENT_CATEGORY, - eventAction: "links", - eventName: "Ethereum.org Github Bug Report", - }) + customEventOptions={{ + eventCategory: EVENT_CATEGORY, + eventAction: "links", + eventName: "Ethereum.org Github Bug Report", }} > {t("page-resources-found-bug")}