Skip to content

Commit 589900e

Browse files
committed
feat: add share qrcode
1 parent c522cac commit 589900e

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

apps/frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"lucide-svelte": "^0.435.0",
9191
"mode-watcher": "^0.4.1",
9292
"paneforge": "^0.0.5",
93+
"svelte-qrcode": "^1.0.0",
9394
"svelte-radix": "^1.1.1",
9495
"svelte-sonner": "^0.3.27",
9596
"sveltekit-superforms": "^2.17.0",

apps/frontend/src/lib/components/blocks/share/share-button.svelte

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { getTable } from "$lib/store/table.store"
66
import { trpc } from "$lib/trpc/client"
77
import { createMutation } from "@tanstack/svelte-query"
8-
import { CopyIcon, ShareIcon, CopyCheckIcon, ExternalLinkIcon } from "lucide-svelte"
8+
import { CopyIcon, ShareIcon, CopyCheckIcon, ExternalLinkIcon, QrCodeIcon } from "lucide-svelte"
99
import * as Popover from "$lib/components/ui/popover"
1010
import { shareStore } from "$lib/store/share.store"
1111
import { invalidate } from "$app/navigation"
@@ -17,6 +17,8 @@
1717
import { hasPermission } from "$lib/store/space-member.store"
1818
import Textarea from "$lib/components/ui/textarea/textarea.svelte"
1919
import { match } from "ts-pattern"
20+
import QrCode from "svelte-qrcode"
21+
import * as HoverCard from "$lib/components/ui/hover-card"
2022
2123
export let type: IShareTarget["type"]
2224
export let id: IShareTarget["id"]
@@ -170,6 +172,15 @@
170172
<CopyIcon class="h-4 w-4" />
171173
{/if}
172174
</button>
175+
176+
<HoverCard.Root>
177+
<HoverCard.Trigger>
178+
<QrCodeIcon class="h-4 w-4" />
179+
</HoverCard.Trigger>
180+
<HoverCard.Content>
181+
<QrCode value={url} />
182+
</HoverCard.Content>
183+
</HoverCard.Root>
173184
</div>
174185
</div>
175186

bun.lockb

5.64 KB
Binary file not shown.

0 commit comments

Comments
 (0)