adds data preloading back

This commit is contained in:
Christian Beutel
2025-01-10 17:12:00 +01:00
parent 4ee3162654
commit ace5ebb607
5 changed files with 9 additions and 40 deletions

View File

@@ -92,10 +92,6 @@
}
$: user = browser ? $currentUser : pb.authStore.model;
function loggedIn() {
return user !== null && user !== undefined;
}
</script>
<Drawer bind:open={drawerOpen}>
@@ -112,17 +108,10 @@
</div>
<div class="flex flex-col px-12 gap-8">
{#each navBarItems as item}
<a
class="font-semibold text-xl"
href={item.value}
data-sveltekit-preload-data="off">{item.text}</a
>
<a class="font-semibold text-xl" href={item.value}>{item.text}</a>
{/each}
{#if $currentUser}
<a
class="font-semibold text-xl"
href="/lists"
data-sveltekit-preload-data="off"
<a class="font-semibold text-xl" href="/lists"
>{$_("list", { values: { n: 2 } })}</a
>
{/if}
@@ -139,10 +128,7 @@
<a href="/profile/{user.id}">
<img
class="rounded-full w-10 aspect-square"
src={getFileURL(
user,
user.avatar,
) ||
src={getFileURL(user, user.avatar) ||
`https://api.dicebear.com/7.x/initials/svg?seed=${user.username}&backgroundType=gradientLinear`}
alt="avatar"
/>
@@ -172,7 +158,7 @@
</Drawer>
<nav class="flex justify-between items-center p-6">
<a href="/" data-sveltekit-preload-data="off">
<a href="/">
{#if $theme == "light"}
<LogoText></LogoText>
{:else}
@@ -185,17 +171,10 @@
style="width: {$indicatorWidth}px; left: {$indicatorPosition}px; scale: {$indicatorScale}"
></div>
{#each navBarItems as item}
<a
class="font-semibold z-10"
href={item.value}
data-sveltekit-preload-data="off">{item.text}</a
>
<a class="font-semibold z-10" href={item.value}>{item.text}</a>
{/each}
{#if user}
<a
class="font-semibold z-10"
href="/lists"
data-sveltekit-preload-data="off"
<a class="font-semibold z-10" href="/lists"
>{$_("list", { values: { n: 2 } })}</a
>
{/if}
@@ -226,10 +205,7 @@
>
<img
class="rounded-full w-full h-full"
src={getFileURL(
user,
user.avatar,
) ||
src={getFileURL(user, user.avatar) ||
`https://api.dicebear.com/7.x/initials/svg?seed=${user.username}&backgroundType=gradientLinear`}
alt="avatar"
/>

View File

@@ -178,7 +178,6 @@
class="max-w-full flex-1"
class:basis-full={selectedDisplayOption === "list"}
href="/trail/view/{trail.id}"
data-sveltekit-preload-data="off"
>
{#if selectedDisplayOption === "cards"}
<TrailCard fullWidth={fullWidthCards} {trail}

View File

@@ -69,7 +69,7 @@
{/if}
<NavBar></NavBar>
<PageLoadingBar ></PageLoadingBar>
<PageLoadingBar class="text-content"></PageLoadingBar>
<Toast></Toast>
<slot />

View File

@@ -138,7 +138,6 @@
<a
class="inline-block btn-primary btn-large"
href="/trail/edit/new"
data-sveltekit-preload-data="off"
role="button">{$_("new-trail")}</a
>
{:else}
@@ -153,7 +152,6 @@
<a
class="inline-block btn-primary btn-large"
href="/trails"
data-sveltekit-preload-data="off"
role="button">{$_("explore")}</a
>
{/if}
@@ -173,10 +171,7 @@
class="grid grid-cols-1 lg:grid-cols-2 justify-items-center gap-8 py-8"
>
{#each $categories as category}
<a
href="/trails?category={category.id}"
data-sveltekit-preload-data="off"
>
<a href="/trails?category={category.id}">
<CategoryCard {category}></CategoryCard>
</a>
{/each}

View File

@@ -256,7 +256,6 @@
{/if}
{#each trails as trail, i}
<a
data-sveltekit-preload-data="off"
href="map/trail/{trail.id}"
>
<TrailCard