Skip to content

Commit 24238b3

Browse files
feat: add information toasts when clicking on the reactions
1 parent f60d541 commit 24238b3

File tree

4 files changed

+42
-8
lines changed

4 files changed

+42
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"svelte-check": "^4.1.6",
5656
"svelte-exmarkdown": "^5.0.0",
5757
"svelte-meta-tags": "^4.2.0",
58-
"svelte-sonner": "^0.3.28",
58+
"svelte-sonner": "https://pkg.pr.new/wobsoriano/svelte-sonner@126",
5959
"tailwind-merge": "^3.2.0",
6060
"tailwind-variants": "^1.0.0",
6161
"tailwindcss": "^4.1.4",

pnpm-lock.yaml

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script lang="ts">
2+
import { ArrowUpRight } from "@lucide/svelte";
3+
import { Button } from "$lib/components/ui/button";
4+
5+
type Props = {
6+
href?: string;
7+
};
8+
let { href }: Props = $props();
9+
</script>
10+
11+
<h3 class="text-sm">Sorry, you can't react to releases here!</h3>
12+
<div class="flex items-center-safe justify-between">
13+
<h4 class="text-sm text-muted-foreground">Click here to open this release on GitHub</h4>
14+
<Button size="sm" variant="secondary" {href} target="_blank" class="group/button">
15+
<img src="/github.svg" alt="GitHub" class="size-4 dark:invert" />
16+
<ArrowUpRight
17+
class="size-4 transition-transform duration-300 group-hover/button:translate-x-0.5 group-hover/button:-translate-y-0.5"
18+
/>
19+
</Button>
20+
</div>

src/routes/package/[...package]/ReleaseCard.svelte

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { ArrowUpRight } from "@lucide/svelte";
33
import { confetti } from "@neoconfetti/svelte";
44
import semver from "semver";
5+
import { toast } from "svelte-sonner";
56
import MarkdownRenderer from "$lib/components/MarkdownRenderer.svelte";
67
import type { GitHubRelease } from "$lib/server/github-cache";
78
import type { Entries } from "$lib/types";
@@ -10,6 +11,7 @@
1011
import * as Accordion from "$lib/components/ui/accordion";
1112
import * as Tooltip from "$lib/components/ui/tooltip";
1213
import ListElementRenderer from "$lib/components/renderers/ListElementRenderer.svelte";
14+
import ReactionToast from "$lib/components/ReactionToast.svelte";
1315
1416
type Props = {
1517
index?: number;
@@ -255,7 +257,18 @@
255257
>}
256258
<div class="flex flex-wrap gap-1.5">
257259
{#each reactionEntries as [key, value] (key)}
258-
<Badge variant="outline" class="text-sm">{reactionsEmojis[key]} {value}</Badge>
260+
<Badge
261+
variant="outline"
262+
class="text-sm select-none"
263+
onclick={() =>
264+
toast(ReactionToast, {
265+
duration: 5_000,
266+
componentProps: { href: release.html_url }
267+
})}
268+
>
269+
{reactionsEmojis[key]}
270+
{value}
271+
</Badge>
259272
{/each}
260273
</div>
261274
{/if}

0 commit comments

Comments
 (0)