From 6b799fac42562d000f43e6a2abbefcd337dcff0d Mon Sep 17 00:00:00 2001 From: dayhaysoos Date: Wed, 30 Oct 2024 14:43:59 -0400 Subject: [PATCH] properly handle links --- site-new/src/components/Card.tsx | 78 ++++++++++--------- site-new/src/components/Hero.tsx | 6 +- .../src/page-components/community/index.tsx | 6 +- 3 files changed, 46 insertions(+), 44 deletions(-) diff --git a/site-new/src/components/Card.tsx b/site-new/src/components/Card.tsx index 50e207d82..c5b18a22d 100644 --- a/site-new/src/components/Card.tsx +++ b/site-new/src/components/Card.tsx @@ -11,6 +11,7 @@ import JSMobile from "@site/assets/icons/JSMobile"; import GoMobile from "@site/assets/icons/GoMobile"; import KotlinMobile from "@site/assets/icons/KotlinMobile"; import { IconButtonLink } from "./IconButton"; +import Link from "@docusaurus/Link"; type CardProps = { icon?: React.ComponentType<{ className: string; fill?: string }>; @@ -113,14 +114,12 @@ function Card({ text, buttonText, url, - orientation = "vertical", // Default orientation is vertical + orientation = "vertical", size = "large", ...props }: CardProps) { const Image = image; - const selectedTheme = theme || randomTheme(); - const isHoverEnabled = props.type === "buttonText" || props.type === "default" || !props.type; @@ -165,11 +164,8 @@ function Card({ const currentSize = sizeClasses[size]; - return ( -
- {/* image */} + const CardContent = ( + <> {Image && ( )} - {/* card body container */}
- {/* icon */} {Icon && ( )} - {/* eyebrow for spotlight card */} {eyebrow &&

{eyebrow}

} - {/* card heading */} - {/* card text */} {text &&

{text}

} - {/* button text */} {url && buttonText && (
+ + ); + + return url && !buttonText ? ( + + {CardContent} + + ) : ( +
+ {CardContent}
); } diff --git a/site-new/src/components/Hero.tsx b/site-new/src/components/Hero.tsx index 9b51abf1a..89f086e71 100644 --- a/site-new/src/components/Hero.tsx +++ b/site-new/src/components/Hero.tsx @@ -15,9 +15,9 @@ function Hero({ subject, title, description, url }: HeroProps): JSX.Element { return ( diff --git a/site-new/src/page-components/community/index.tsx b/site-new/src/page-components/community/index.tsx index cb3958cb0..57e2eda23 100644 --- a/site-new/src/page-components/community/index.tsx +++ b/site-new/src/page-components/community/index.tsx @@ -19,17 +19,17 @@ const features = [ const explore = [ { title: "Code of Conduct", - url: "/open-source/code-of-conduct", + url: "/community/code-of-conduct", text: "We’re building open protocols, standards, and libraries. Our projects are open source because we want everyone in the economy to benefit: individuals, businesses, institutions, and government.", }, { title: "Governance", - url: "/open-source/governance", + url: "/community/governance", text: "We’re building open protocols, standards, and libraries. Our projects are open source because we want everyone in the economy to benefit: individuals, businesses, institutions, and government.", }, { title: "Monthly Spotlight", - url: "/open-source/monthly-spotlight", + url: "/community/spotlight", text: "We’re building open protocols, standards, and libraries. Our projects are open source because we want everyone in the economy to benefit: individuals, businesses, institutions, and government.", }, {