Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the Card component to use the Docusaurus Link component #107

Merged
merged 3 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/Blog/ReleaseCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ export default function ReleaseCard({ library, version, releaseType }: ReleaseCa
</div>
);
}



3 changes: 2 additions & 1 deletion src/components/Extras/Card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { ComponentPropsWithoutRef, ElementType, ReactNode, Ref } from "react";
import Link from "@docusaurus/Link";
import styles from "./Card.module.css";
import clsx from "clsx";
import { CardImage } from "./CardImage";
Expand Down Expand Up @@ -57,7 +58,7 @@ export function Card<T extends ElementType = "div">({
titleIcon,
...props
}: CardProps<T>) {
const Component = as || props.href != undefined ? "a" : "div";
const Component = as || props.href != undefined ? Link : "div";
const isImageSrc: boolean = typeof icon === "string";

const renderIcon: JSX.Element = (
Expand Down
6 changes: 3 additions & 3 deletions src/pages/internal/extras/Card.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ High-performance realtime and compatible APIs
</Card>
<Card
title="Messaging"
href="/sms"
href="/messaging"
icon="/landing-assets/images/svg/ico-sms.svg"
>
High-throughput, compliant, programmable SMS and MMS
Expand Down Expand Up @@ -287,14 +287,14 @@ Send and receive faxes
</Card>
<Card
title="SWML"
href="/sdks/reference/swml/introduction"
href="/swml"
icon="/landing-assets/images/svg/ico-swml.svg"
>
Low-code, server-optional application builder
</Card>
<Card
title="AI"
href="/sdks/reference/swml/methods/ai/"
href="/swml/guides/ai"
icon="/landing-assets/images/svg/ico-ai.svg"
>
Incorporate AI functionality in minutes
Expand Down