Update to svelte 5
This commit is contained in:
@@ -10,7 +10,7 @@ import { highlight_current_page } from "lib/HighlightCurrentPage";
|
||||
<i class="icon">{bookmark.icon}</i>
|
||||
<span class="hide_small">{bookmark.label}</span>
|
||||
</a>
|
||||
<button on:click={() => bookmark_del(bookmark.id)}>
|
||||
<button onclick={() => bookmark_del(bookmark.id)}>
|
||||
<i class="icon">delete</i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -71,7 +71,7 @@ onMount(async () => {
|
||||
<span class="hide_small">Admin Panel</span>
|
||||
</a>
|
||||
{/if}
|
||||
<button class="button" on:click={()=> logout_user("/")}>
|
||||
<button class="button" onclick={()=> logout_user("/")}>
|
||||
<i class="icon">logout</i>
|
||||
<span class="hide_small">Log out</span>
|
||||
</button>
|
||||
|
||||
@@ -12,7 +12,7 @@ import Footer from "layout/Footer.svelte";
|
||||
import { current_page_store, type Tab } from "./RouterStore";
|
||||
import { get_user, type User } from "lib/PixeldrainAPI";
|
||||
|
||||
export let pages: Tab[] = [
|
||||
let pages: Tab[] = [
|
||||
{
|
||||
path: "/",
|
||||
title: "Home",
|
||||
@@ -61,7 +61,7 @@ onMount(async () => {
|
||||
load_page(window.location.pathname, false)
|
||||
})
|
||||
|
||||
let current_page: Tab = null
|
||||
let current_page: Tab = $state(null)
|
||||
|
||||
const load_page = (pathname: string, history: boolean): boolean => {
|
||||
console.debug("Navigating to page", pathname, "log history:", history)
|
||||
@@ -142,11 +142,11 @@ const popstate = (e: PopStateEvent) => {
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:document on:click={click}/>
|
||||
<svelte:window on:popstate={popstate}/>
|
||||
<svelte:document onclick={click}/>
|
||||
<svelte:window onpopstate={popstate}/>
|
||||
|
||||
{#if current_page !== null}
|
||||
<svelte:component this={current_page.component} />
|
||||
<current_page.component />
|
||||
|
||||
{#if current_page.footer === undefined || current_page.footer === true}
|
||||
<Footer/>
|
||||
|
||||
Reference in New Issue
Block a user