Skip to content

Commit

Permalink
add button link to tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
FoggyMtnDrifter committed Mar 19, 2024
1 parent 5e8debc commit 510cd83
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/[locale]/download/components/DownloadCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
import { QuestionMarkCircledIcon } from "@radix-ui/react-icons";
import { Tabs } from "@/components/ui/tabs";
import VersionPicker from "./VersionPicker";
import Link from "next/link";
import { Url } from "next/dist/shared/lib/router/router";

interface DownloadOption {
label: string;
Expand Down Expand Up @@ -38,7 +40,8 @@ interface DownloadCardProps {
title: string;
titleTooltip: boolean;
titleTooltipText?: TooltipText[];
titleTooltipButtonLabel?: string;
titleTooltipButtonLabel: string;
titleTooltipButtonLink: Url;
versions: VersionItem[];
}

Expand All @@ -47,6 +50,7 @@ const DownloadCard: React.FC<DownloadCardProps> = ({
titleTooltip,
titleTooltipText,
titleTooltipButtonLabel,
titleTooltipButtonLink,
versions,
}) => (
<Card>
Expand All @@ -69,7 +73,9 @@ const DownloadCard: React.FC<DownloadCardProps> = ({
{line.text}
</p>
))}
<Button className="mt-2">{titleTooltipButtonLabel}</Button>
<Link href={titleTooltipButtonLink}>
<Button className="mt-2">{titleTooltipButtonLabel}</Button>
</Link>
</HoverCardContent>
</HoverCard>
) : (
Expand Down
4 changes: 4 additions & 0 deletions app/[locale]/download/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const DownloadPage = () => {
text: `${t("cards.defaultImages.tooltips.minimal")}`,
},
]}
titleTooltipButtonLink="https://docs.rockylinux.org/guides/installation/"
titleTooltipButtonLabel={t(
"cards.defaultImages.tooltips.buttonLabel"
)}
Expand Down Expand Up @@ -159,6 +160,7 @@ const DownloadPage = () => {
text: `${t("cards.defaultImages.tooltips.minimal")}`,
},
]}
titleTooltipButtonLink="https://docs.rockylinux.org/guides/installation/"
titleTooltipButtonLabel={t(
"cards.defaultImages.tooltips.buttonLabel"
)}
Expand Down Expand Up @@ -259,6 +261,7 @@ const DownloadPage = () => {
text: `${t("cards.defaultImages.tooltips.minimal")}`,
},
]}
titleTooltipButtonLink="https://docs.rockylinux.org/guides/installation/"
titleTooltipButtonLabel={t(
"cards.defaultImages.tooltips.buttonLabel"
)}
Expand Down Expand Up @@ -321,6 +324,7 @@ const DownloadPage = () => {
text: `${t("cards.defaultImages.tooltips.minimal")}`,
},
]}
titleTooltipButtonLink="https://docs.rockylinux.org/guides/installation/"
titleTooltipButtonLabel={t(
"cards.defaultImages.tooltips.buttonLabel"
)}
Expand Down

0 comments on commit 510cd83

Please sign in to comment.