Skip to content

Commit

Permalink
fix: correct href for action button
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxi-ream committed Jan 6, 2024
1 parent 8f738a6 commit eea01db
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .history/components/action-button_20240106095840.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"use client";

import { Button } from "@/components/ui/button";
import { Icons } from "@/components/icons";
import { usePrint } from "@/components/print-provider";

type Props = {
text: string;
className?: string;
usage: "live" | "pdf";
};

export default function ActionButton({ text, className, usage }: Props) {
const { handlePrint } = usePrint();
return usage === "live" ? (
<Button onClick={handlePrint} className={className}>
{text}
</Button>
) : (
<Button href="/resume">
{text}
<Icons.OpenLink className="h-4 w-4 stroke-zinc-400 transition group-active:stroke-zinc-600 dark:group-hover:stroke-zinc-50 dark:group-active:stroke-zinc-50" />
</Button>
);
}
25 changes: 25 additions & 0 deletions .history/components/action-button_20240106100028.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"use client";

import { Button } from "@/components/ui/button";
import { Icons } from "@/components/icons";
import { usePrint } from "@/components/print-provider";

type Props = {
text: string;
className?: string;
usage: "live" | "pdf";
};

export default function ActionButton({ text, className, usage }: Props) {
const { handlePrint } = usePrint();
return usage === "live" ? (
<Button onClick={handlePrint} className={className}>
{text}
</Button>
) : (
<Button href="/">
{text}
<Icons.OpenLink className="h-4 w-4 stroke-zinc-400 transition group-active:stroke-zinc-600 dark:group-hover:stroke-zinc-50 dark:group-active:stroke-zinc-50" />
</Button>
);
}
2 changes: 1 addition & 1 deletion components/action-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function ActionButton({ text, className, usage }: Props) {
{text}
</Button>
) : (
<Button href="/resume">
<Button href="/">
{text}
<Icons.OpenLink className="h-4 w-4 stroke-zinc-400 transition group-active:stroke-zinc-600 dark:group-hover:stroke-zinc-50 dark:group-active:stroke-zinc-50" />
</Button>
Expand Down

0 comments on commit eea01db

Please sign in to comment.