From f016ad68aea3183150ff34917a2eb96dec7a9a52 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Fri, 3 May 2024 12:20:16 -0700 Subject: [PATCH 1/5] add id to chain page charts container --- components/layout/ChainChart.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/layout/ChainChart.tsx b/components/layout/ChainChart.tsx index c163df4e..94d70c4a 100644 --- a/components/layout/ChainChart.tsx +++ b/components/layout/ChainChart.tsx @@ -1530,6 +1530,7 @@ export default function ChainChart({ {data && (
Date: Fri, 3 May 2024 13:08:31 -0700 Subject: [PATCH 2/5] added content-container ids to og pages --- components/layout/CategoryMetrics.tsx | 890 +++++++++++++------------- components/layout/ChainChart.tsx | 2 +- components/layout/ComparisonChart.tsx | 1 + components/layout/Container.tsx | 3 + components/layout/OverviewMetrics.tsx | 5 +- 5 files changed, 459 insertions(+), 442 deletions(-) diff --git a/components/layout/CategoryMetrics.tsx b/components/layout/CategoryMetrics.tsx index 737704dc..74475c0d 100644 --- a/components/layout/CategoryMetrics.tsx +++ b/components/layout/CategoryMetrics.tsx @@ -1129,49 +1129,50 @@ export default function CategoryMetrics({
*/} - -
- + +
- {!openSub ? ( -
- {Object.keys(categories).map((category, i) => - categories[category] !== "Categories" ? ( -
{ - setIsCategoryHovered((prev) => ({ - ...prev, - [category]: true, - })); - }} - onMouseLeave={() => { - setIsCategoryHovered((prev) => ({ - ...prev, - [category]: false, - })); - }} - style={{ - borderLeft: - "0.5px dotted var(--dark-active-text, #CDD8D3)", - background: + + {!openSub ? ( +
+ {Object.keys(categories).map((category, i) => + categories[category] !== "Categories" ? ( +
{ + setIsCategoryHovered((prev) => ({ + ...prev, + [category]: true, + })); + }} + onMouseLeave={() => { + setIsCategoryHovered((prev) => ({ + ...prev, + [category]: false, + })); + }} + style={{ + borderLeft: + "0.5px dotted var(--dark-active-text, #CDD8D3)", + background: + selectedCategory === category + ? "#5A6462" + : theme === "light" + ? "#FFFFFF" + : `linear-gradient( 90deg, rgba(16, 20, 19, ${ 0.3 - @@ -1190,111 +1191,112 @@ export default function CategoryMetrics({ 0.2 }) 100% )`, - }} - > -
{ - if (selectedCategory === category) { - handleOpen(category); - } - - setSelectedCategory(category); }} >
-

{categories[category]}

-
- -
{ - handleOpen(category); + if (selectedCategory === category) { + handleOpen(category); + } + + setSelectedCategory(category); }} > - +
+

{categories[category]}

+
+ +
{ + handleOpen(category); + }} + > + +
-
- ) : ( - // Different response for "Chains" category -
-
- {categories[category]} -
-
- Subcategories + ) : ( + // Different response for "Chains" category +
+
+ {categories[category]} +
+
+ Subcategories +
-
- ), - )} -
- ) : ( -
- {categoryTransitions((style, item) => - categories[item.category] !== "Categories" ? ( - 8 - ? "w-[650px]" - : Object.keys( - data[item.category].subcategories, - ).length > 5 - ? "w-[500px]" - : "w-[400px]" - }` - : "h-full w-full min-w-[40px] hover:max-w-[180px]" - } + ), + )} +
+ ) : ( +
+ {categoryTransitions((style, item) => + categories[item.category] !== "Categories" ? ( + 8 + ? "w-[650px]" + : Object.keys( + data[item.category].subcategories, + ).length > 5 + ? "w-[500px]" + : "w-[400px]" + }` + : "h-full w-full min-w-[40px] hover:max-w-[180px]" + } ${isCategoryHovered[item.category] ? "bg-white/5" : ""} `} - onMouseEnter={() => { - setIsCategoryHovered((prev) => ({ - ...prev, - [item.category]: true, - })); - }} - onMouseLeave={() => { - setIsCategoryHovered((prev) => ({ - ...prev, - [item.category]: false, - })); - }} - style={{ - borderLeft: - "0.5px dotted var(--dark-active-text, #CDD8D3)", - background: - selectedCategory === item.category - ? "#5A6462" - : theme === "light" - ? "#FFFFFF" - : `linear-gradient( + onMouseEnter={() => { + setIsCategoryHovered((prev) => ({ + ...prev, + [item.category]: true, + })); + }} + onMouseLeave={() => { + setIsCategoryHovered((prev) => ({ + ...prev, + [item.category]: false, + })); + }} + style={{ + borderLeft: + "0.5px dotted var(--dark-active-text, #CDD8D3)", + background: + selectedCategory === item.category + ? "#5A6462" + : theme === "light" + ? "#FFFFFF" + : `linear-gradient( 90deg, rgba(16, 20, 19, ${ 0.3 - @@ -1316,345 +1318,353 @@ export default function CategoryMetrics({ 0.2 }) 100% )`, - ...style, - }} - > -
8 - ? "w-[650px]" - : Object.keys( - data[item.category].subcategories, - ).length > 4 - ? "w-[500px]" - : "w-[400px]" - }` - : "hover:bg-white/5 w-full min-w-[40px] hover:max-w-[180px] " - }`} - onClick={() => { - if (selectedCategory === item.category) { - handleOpen(item.category); - return; - } - - setSelectedCategory(item.category); + ...style, }} >
8 + ? "w-[650px]" + : Object.keys( + data[item.category].subcategories, + ).length > 4 + ? "w-[500px]" + : "w-[400px]" }` + : "hover:bg-white/5 w-full min-w-[40px] hover:max-w-[180px] " }`} - style={{ - background: - selectedCategory === item.category - ? "#5A6462" - : "none", - backgroundClip: - selectedCategory === item.category - ? "initial" - : "text", - WebkitBackgroundClip: - selectedCategory === item.category - ? "initial" - : "text", - WebkitTextFillColor: - selectedCategory === item.category - ? "inherit" - : theme === "light" - ? "initial" - : "transparent", - backgroundImage: - selectedCategory === item.category - ? "none" - : theme === "light" - ? "none" - : `radial-gradient(ellipse at center, rgba(255, 255, 255, 1) 0%, rgba(0, 0, 0, 1) 100%), linear-gradient(90deg, rgba(16, 20, 19, ${ - 0.4 + - (item.i / - (Object.keys(categories).length - - 1)) * - 0.4 - }) 0%, #101413 15.10%, rgba(16, 20, 19, 0.00) 48.96%, #101413 86.98%, rgba(16, 20, 19, ${ - 0.4 + - (item.i / - (Object.keys(categories).length - - 1)) * - 0.4 - }) 100%)`, + onClick={() => { + if (selectedCategory === item.category) { + handleOpen(item.category); + return; + } + + setSelectedCategory(item.category); }} > - {categories[item.category]} -
+
+ {categories[item.category]} +
-
- {selectedCategory === item.category ? ( -
8 - ? "w-[600px]" - : Object.keys( - data[item.category].subcategories, - ).length > 4 - ? "w-[450px]" - : "w-[350px]" - }`} - > + > + {selectedCategory === item.category ? (
8 + ? "w-[600px]" + : Object.keys( + data[item.category].subcategories, + ).length > 4 + ? "w-[450px]" + : "w-[350px]" + }`} > - {item.category !== "unlabeled" && - item.category !== "native_transfers" ? ( -
{ - handleSelectAllSubcategories( - item.category, - ); - e.stopPropagation(); - }} - > -
- Select All Subcategories +
+ {item.category !== "unlabeled" && + item.category !== "native_transfers" ? ( +
{ + handleSelectAllSubcategories( + item.category, + ); + e.stopPropagation(); + }} + > +
+ Select All Subcategories +
+
+ +
-
+ ) : null} + {item.category !== "unlabeled" && + item.category !== "native_transfers" ? ( + data[ + item.category + ].subcategories.list.map( + (subcategory) => ( + + ), + ) + ) : ( +
+

+ {" "} + There are currently no subcategories + for the given category.{" "} +

-
- ) : null} - {item.category !== "unlabeled" && - item.category !== "native_transfers" ? ( - data[ - item.category - ].subcategories.list.map( - (subcategory) => ( - - ), - ) - ) : ( -
- -

- {" "} - There are currently no subcategories - for the given category.{" "} -

-
- )} + )} +
-
- ) : null} -
+ ) : null} +
- + +
+ + ) : ( + // Different response for "Chains" category +
+
+ {categories[item.category]} +
+
+ Subcategories +
+ ), + )} +
+ )} +
+
+ + + +
+
+
+ {sortedChainValues && + master && + transitions((style, item) => ( + + - ) : ( - // Different response for "Chains" category + ))} +
+
+
+ {chartSeries && ( + + )} +
+
+
+ {formatSubcategories(selectedCategory)}:{" "} +
+ + {selectedSubcategories[selectedCategory] && + selectedSubcategories[selectedCategory].map( + (subcategory) => (
-
- {categories[item.category]} -
-
- Subcategories -
+ {formatSubcategories(subcategory)}
), )} -
- )} - -
-
- - -
-
-
- {sortedChainValues && - master && - transitions((style, item) => ( - - - - ))}
-
- {chartSeries && ( - - )} -
-
-
- {formatSubcategories(selectedCategory)}:{" "} -
+
+ {" "} +
+
+ {formatSubcategories(selectedCategory)}:{" "} +
- {selectedSubcategories[selectedCategory] && - selectedSubcategories[selectedCategory].map((subcategory) => ( -
- {formatSubcategories(subcategory)} -
- ))} + {selectedSubcategories[selectedCategory] && + selectedSubcategories[selectedCategory].map( + (subcategory) => ( +
+ {formatSubcategories(subcategory)} +
+ ), + )} +
{" "}
-
-
- {" "} -
-
- {formatSubcategories(selectedCategory)}:{" "} -
- - {selectedSubcategories[selectedCategory] && - selectedSubcategories[selectedCategory].map((subcategory) => ( -
- {formatSubcategories(subcategory)} -
- ))} -
{" "} -
- + +
{" "}
diff --git a/components/layout/ChainChart.tsx b/components/layout/ChainChart.tsx index 94d70c4a..0fc1194f 100644 --- a/components/layout/ChainChart.tsx +++ b/components/layout/ChainChart.tsx @@ -1530,7 +1530,7 @@ export default function ChainChart({ {data && (
; style?: React.CSSProperties; @@ -7,12 +8,14 @@ type ContainerProps = { export default function Container({ children, + id, ref, className = "", style, }: ContainerProps) { return (
{/*Chain Rows/List */} - + Date: Fri, 3 May 2024 13:46:16 -0700 Subject: [PATCH 3/5] sitemap changes, redirect for chain-overview --- app/(layout)/server-sitemap.xml/route.ts | 4 ++++ components/layout/LandingChart.tsx | 5 ++++- lib/navigation.tsx | 1 + next.config.js | 5 +++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/(layout)/server-sitemap.xml/route.ts b/app/(layout)/server-sitemap.xml/route.ts index 2a2d3c3f..feedbb4c 100644 --- a/app/(layout)/server-sitemap.xml/route.ts +++ b/app/(layout)/server-sitemap.xml/route.ts @@ -27,6 +27,10 @@ export async function GET(request: Request) { .map( (option) => `https://www.growthepie.xyz/blockspace/${option.urlKey}`, ), + ...Object.keys(masterData.blockspace_categories.main_categories).map( + (category) => + `https://www.growthepie.xyz/blockspace/chain-overview/${category}`, + ), ...chains.options .filter( (c) => diff --git a/components/layout/LandingChart.tsx b/components/layout/LandingChart.tsx index b7715c95..faf3cf96 100644 --- a/components/layout/LandingChart.tsx +++ b/components/layout/LandingChart.tsx @@ -1719,7 +1719,10 @@ export default function LandingChart({ ); return ( -
+
Date: Fri, 3 May 2024 16:57:39 -0700 Subject: [PATCH 4/5] hide console log --- components/layout/ComparisonChart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/layout/ComparisonChart.tsx b/components/layout/ComparisonChart.tsx index 4a5a24d8..1d04ccb7 100644 --- a/components/layout/ComparisonChart.tsx +++ b/components/layout/ComparisonChart.tsx @@ -1642,7 +1642,7 @@ export default function ComparisonChart({ // const { width, height } = useWindowSize(); - console.log(data.filter((d) => d.name === "ethereum").length > 0); + // console.log(data.filter((d) => d.name === "ethereum").length > 0); useLayoutEffect(() => { if (chartComponent.current) { From 5332ab182c8d833f11dfce832101039de2286149 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Fri, 3 May 2024 17:20:19 -0700 Subject: [PATCH 5/5] update layouts to only single og image --- app/(embeds)/layout.tsx | 12 ------------ app/(fees)/layout.tsx | 12 ------------ app/(layout)/layout.tsx | 14 +------------- 3 files changed, 1 insertion(+), 37 deletions(-) diff --git a/app/(embeds)/layout.tsx b/app/(embeds)/layout.tsx index d3755a1e..619eb493 100644 --- a/app/(embeds)/layout.tsx +++ b/app/(embeds)/layout.tsx @@ -88,18 +88,6 @@ export const metadata: Metadata = { height: 627, alt: "growthepie.xyz", }, - { - url: "https://www.growthepie.xyz/logo_full.png", - width: 772, - height: 181, - alt: "growthepie.xyz", - }, - { - url: "https://www.growthepie.xyz/logo_pie_only.png", - width: 168, - height: 181, - alt: "growthepie", - }, ], locale: "en_US", type: "website", diff --git a/app/(fees)/layout.tsx b/app/(fees)/layout.tsx index dacdfbf8..e5d7dac8 100644 --- a/app/(fees)/layout.tsx +++ b/app/(fees)/layout.tsx @@ -114,18 +114,6 @@ export const metadata: Metadata = { height: 627, alt: "growthepie.xyz", }, - { - url: `https://${host}/logo_full.png`, - width: 772, - height: 181, - alt: "growthepie.xyz", - }, - { - url: `https://${host}/logo_pie_only.png`, - width: 168, - height: 181, - alt: "growthepie", - }, ], locale: "en_US", type: "website", diff --git a/app/(layout)/layout.tsx b/app/(layout)/layout.tsx index 6847aa8d..d46024f8 100644 --- a/app/(layout)/layout.tsx +++ b/app/(layout)/layout.tsx @@ -84,6 +84,7 @@ export const metadata: Metadata = { title: "growthepie", description: "Growing Ethereum’s Ecosystem Together", url: "https://www.growthepie.xyz", + images: [ { url: "https://www.growthepie.xyz/gtp_og.png", @@ -91,18 +92,6 @@ export const metadata: Metadata = { height: 627, alt: "growthepie.xyz", }, - { - url: "https://www.growthepie.xyz/logo_full.png", - width: 772, - height: 181, - alt: "growthepie.xyz", - }, - { - url: "https://www.growthepie.xyz/logo_pie_only.png", - width: 168, - height: 181, - alt: "growthepie", - }, ], locale: "en_US", type: "website", @@ -174,7 +163,6 @@ export default function RootLayout({
-