Skip to content

Commit

Permalink
Fix the Card component to use the Docusaurus Link component (#107)
Browse files Browse the repository at this point in the history
* fix card to use Docusaurus Link

* fix links

* empty commit
  • Loading branch information
niravcodes authored Mar 3, 2025
1 parent 9174623 commit 7f6355b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
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

0 comments on commit 7f6355b

Please sign in to comment.