Skip to content

Commit a1335b2

Browse files
committed
Link to main page from claim, qr code clickable
1 parent 43e577a commit a1335b2

File tree

5 files changed

+282
-147
lines changed

5 files changed

+282
-147
lines changed

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"use-local-storage-state": "^19.5.0"
2828
},
2929
"devDependencies": {
30+
"@types/qrcode": "^1.5.5",
3031
"@types/react": "^19.0.11",
3132
"@types/react-dom": "^19.0.4",
3233
"vite-plugin-node-polyfills": "^0.17.0"

apps/web/src/components/Qrcode.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,9 @@ export const Qrcode = ({ payload }: Props) => {
1010
qrcode.toCanvas(document.getElementById("canvas"), payload, { width: 208 });
1111
});
1212

13-
return <canvas id="canvas" className="rounded-lg" />;
13+
return (
14+
<a href={payload}>
15+
<canvas id="canvas" className="rounded-lg" />
16+
</a>
17+
);
1418
};

apps/web/src/components/ui/Link.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ type Props = DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HT
55
isExternal?: boolean;
66
};
77

8-
export const Link = ({ children, isExternal = false, ...rest }: Props) => (
9-
<a className="flex items-center gap-2 text-orange hover:underline" {...rest}>
8+
export const Link = ({ children, className, isExternal = false, ...rest }: Props) => (
9+
<a
10+
className={"inline-flex items-center gap-2 text-orange hover:underline".concat(
11+
" ",
12+
className || "",
13+
)}
14+
{...rest}
15+
>
1016
{children}
1117

1218
{isExternal && <ExternalLink size={16} />}

0 commit comments

Comments
 (0)