mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-05 18:48:41 +00:00
fix: properly resolve dynamic urls
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
|
||||
{#if compact}
|
||||
<a
|
||||
href={resolve(`/${paste.id}`)}
|
||||
href={resolve(`/[id]`, { id: paste.id })}
|
||||
class="flex flex-col gap-1 rounded border border-neutral-700 bg-neutral-800 px-4 py-3 transition-colors duration-200 hover:bg-neutral-700 focus:ring-2 focus:ring-neutral-600 focus:outline-none"
|
||||
>
|
||||
<div class="flex w-full flex-row justify-between">
|
||||
@@ -119,7 +119,7 @@
|
||||
</a>
|
||||
{:else}
|
||||
<a
|
||||
href={resolve(`/${paste.id}`)}
|
||||
href={resolve(`/[id]`, { id: paste.id })}
|
||||
class="flex flex-col gap-2 rounded border border-neutral-700 bg-neutral-800 px-5 py-4 transition-colors duration-200 hover:bg-neutral-700 focus:ring-2 focus:ring-neutral-600 focus:outline-none"
|
||||
>
|
||||
<span
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
<span class="text-red-500">BANNED</span>
|
||||
{/if}
|
||||
<a
|
||||
href={resolve(`/user/${node.author?.username}`)}
|
||||
href={resolve(`/user/[username]`, { username: node.author?.username})}
|
||||
class="flex items-center gap-2 underline"
|
||||
>
|
||||
<span
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
{#if report.reporterUsername}
|
||||
<a
|
||||
class="text-neutral-200 hover:text-white hover:underline"
|
||||
href={resolve(`/user/${report.reporterUsername}`)}
|
||||
href={resolve(`/user/[username]`, { username: report.reporterUsername})}
|
||||
use:tooltip={report.reporterUUID}
|
||||
>
|
||||
{report.reporterDisplayName || report.reporterUsername}
|
||||
@@ -89,7 +89,7 @@
|
||||
Target Paste:
|
||||
<a
|
||||
class="text-neutral-200 hover:text-white hover:underline"
|
||||
href={resolve(`/${report.pasteId}`)}
|
||||
href={resolve(`/[id]`, { id: report.pasteId})}
|
||||
>
|
||||
{report.pasteTitle !== '' ? report.pasteTitle : report.pasteId}
|
||||
</a>
|
||||
@@ -101,7 +101,7 @@
|
||||
{#if report.targetUsername}
|
||||
<a
|
||||
class="text-neutral-200 hover:text-white hover:underline"
|
||||
href={resolve(`/user/${report.targetUsername}`)}
|
||||
href={resolve(`/user/[username]`, { username: report.targetUsername})}
|
||||
use:tooltip={report.userUUID}
|
||||
>
|
||||
{report.targetDisplayName || report.targetUsername}
|
||||
|
||||
@@ -200,11 +200,11 @@
|
||||
class="flex cursor-pointer flex-col gap-2 rounded border border-neutral-700 bg-neutral-800 px-5 py-4 transition-colors duration-200 hover:bg-neutral-700 focus:ring-2 focus:ring-neutral-600 focus:outline-none"
|
||||
role="link"
|
||||
tabindex="0"
|
||||
onclick={() => goto(resolve(`/report/${report.reportID}`))}
|
||||
onclick={() => goto(resolve(`/report/[reportId]`, { reportId: String(report.reportID)}))}
|
||||
onkeydown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
goto(resolve(`/report/${report.reportID}`));
|
||||
goto(resolve(`/report/[reportId]`, { reportId: String(report.reportID)}));
|
||||
}
|
||||
}}
|
||||
>
|
||||
@@ -221,7 +221,7 @@
|
||||
<span>{reportTargetLabels[report.targetType] ?? 'Unknown'}</span>
|
||||
{#if report.pasteId}
|
||||
<a
|
||||
href={resolve(`/${report.pasteId}`)}
|
||||
href={resolve(`/[id]`, { id: report.pasteId})}
|
||||
class="text-neutral-300 hover:text-white"
|
||||
onclick={stopPropagation(bubble('click'))}
|
||||
>
|
||||
@@ -231,7 +231,7 @@
|
||||
{#if report.userUUID}
|
||||
{#if report.targetUsername}
|
||||
<a
|
||||
href={resolve(`/user/${report.targetUsername}`)}
|
||||
href={resolve(`/user/[username]`, {username: report.targetUsername})}
|
||||
class="text-neutral-300 hover:text-white"
|
||||
use:tooltip={report.userUUID}
|
||||
onclick={stopPropagation(bubble('click'))}
|
||||
@@ -244,7 +244,7 @@
|
||||
{/if}
|
||||
{#if report.reporterUsername}
|
||||
<a
|
||||
href={resolve(`/user/${report.reporterUsername}`)}
|
||||
href={resolve(`/user/[username]`, { username: report.reporterUsername})}
|
||||
class="text-neutral-300 hover:text-white"
|
||||
use:tooltip={report.reporterUUID}
|
||||
onclick={stopPropagation(bubble('click'))}
|
||||
|
||||
@@ -1676,11 +1676,11 @@
|
||||
class="flex cursor-pointer flex-col gap-2 rounded border border-neutral-700 bg-neutral-800 px-5 py-4 transition-colors duration-200 hover:bg-neutral-700 focus:ring-2 focus:ring-neutral-600 focus:outline-none"
|
||||
role="link"
|
||||
tabindex="0"
|
||||
onclick={() => goto(resolve(`/report/${report.reportID}`))}
|
||||
onclick={() => goto(resolve(`/report/[reportId]`, { reportId: String(report.reportID)}))}
|
||||
onkeydown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
goto(resolve(`/report/${report.reportID}`));
|
||||
goto(resolve(`/report/[reportId]`, { reportId: String(report.reportID)}));
|
||||
}
|
||||
}}
|
||||
>
|
||||
@@ -1697,7 +1697,7 @@
|
||||
<span>{reportTargetLabels[report.targetType] ?? 'Unknown'}</span>
|
||||
{#if report.pasteId}
|
||||
<a
|
||||
href={resolve(`/${report.pasteId}`)}
|
||||
href={resolve(`/[id]`, {id:report.pasteId})}
|
||||
class="text-neutral-300 hover:text-white"
|
||||
onclick={stopPropagation(bubble('click'))}
|
||||
>
|
||||
@@ -1707,7 +1707,7 @@
|
||||
{#if report.userUUID}
|
||||
{#if report.targetUsername}
|
||||
<a
|
||||
href={resolve(`/user/${report.targetUsername}`)}
|
||||
href={resolve(`/user/[username]`, { username: report.targetUsername})}
|
||||
class="text-neutral-300 hover:text-white"
|
||||
use:tooltip={report.userUUID}
|
||||
onclick={stopPropagation(bubble('click'))}
|
||||
@@ -1735,11 +1735,11 @@
|
||||
class="flex cursor-pointer flex-col gap-2 rounded border border-neutral-700 bg-neutral-800 px-5 py-4 transition-colors duration-200 hover:bg-neutral-700 focus:ring-2 focus:ring-neutral-600 focus:outline-none"
|
||||
role="link"
|
||||
tabindex="0"
|
||||
onclick={() => goto(resolve(`/report/${report.reportID}`))}
|
||||
onclick={() => goto(resolve(`/report/[reportId]`, { reportId: String(report.reportID)}))}
|
||||
onkeydown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
goto(resolve(`/report/${report.reportID}`));
|
||||
goto(resolve(`/report/[reportId]`, { reportId: String(report.reportID)}));
|
||||
}
|
||||
}}
|
||||
>
|
||||
@@ -1756,7 +1756,7 @@
|
||||
<span>{reportTargetLabels[report.targetType] ?? 'Unknown'}</span>
|
||||
{#if report.reporterUsername}
|
||||
<a
|
||||
href={resolve(`/user/${report.reporterUsername}`)}
|
||||
href={resolve(`/user/[username]`, { username: report.reporterUsername})}
|
||||
class="text-neutral-300 hover:text-white"
|
||||
use:tooltip={report.reporterUUID}
|
||||
onclick={stopPropagation(bubble('click'))}
|
||||
@@ -1768,7 +1768,7 @@
|
||||
{/if}
|
||||
{#if report.pastePID}
|
||||
<a
|
||||
href={resolve(`/${report.pasteId ?? report.pastePID}`)}
|
||||
href={resolve(`/[id]`, { id: report.pasteId ?? ""})}
|
||||
class="text-neutral-300 hover:text-white"
|
||||
onclick={stopPropagation(bubble('click'))}
|
||||
>
|
||||
@@ -1778,7 +1778,7 @@
|
||||
{#if report.userUUID}
|
||||
{#if report.targetUsername}
|
||||
<a
|
||||
href={resolve(`/user/${report.targetUsername}`)}
|
||||
href={resolve(`/user/[username]`, { username: report.targetUsername})}
|
||||
class="text-neutral-300 hover:text-white"
|
||||
use:tooltip={report.userUUID}
|
||||
onclick={stopPropagation(bubble('click'))}
|
||||
|
||||
Reference in New Issue
Block a user