Skip to content

Commit e5fd2ff

Browse files
committed
refactor: remove deprecated kit page store
fixes #118
1 parent df790c5 commit e5fd2ff

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

frontend/src/app.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// See https://svelte.dev/docs/kit/types#app.d.ts
2-
import type { components } from '$lib/clients/v1';
2+
import type { components } from '$lib/clients/v1/schema';
33

44
type Profile = components['schemas']['Profile'];
55

frontend/src/lib/components/header.svelte

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { page } from '$app/stores';
2+
import { page } from '$app/state';
33
import ChartBarsIcon from '$lib/components/icons/chart_bars.svelte';
44
import QuibbleLogo from '$lib/components/icons/logos/quibble.svelte';
55
import QuibbleTextLogo from '$lib/components/icons/logos/quibble_text.svelte';
@@ -15,7 +15,7 @@
1515
let { on_menu_click }: Props = $props();
1616
1717
const show_search_in_community = $derived(
18-
$page.url.pathname.includes('/q/') && $page.data.community
18+
page.url.pathname.includes('/q/') && page.data.community
1919
);
2020
2121
const modalsStore = createModalsStore(),
@@ -61,17 +61,17 @@
6161
<div
6262
class="ml-2 flex items-center gap-2 rounded-lg border border-neutral bg-base-100 p-1 px-1.5"
6363
>
64-
<Avatar src={$page.data.community.avatar} class="size-5 rounded-full" />
64+
<Avatar src={page.data.community.avatar} class="size-5 rounded-full" />
6565
<h5 class="whitespace-nowrap text-xs font-medium">
66-
q/{$page.data.community.name}
66+
q/{page.data.community.name}
6767
</h5>
6868
</div>
6969
{/if}
7070
<input
7171
type="text"
7272
class="grow border-none text-sm font-medium focus:ring-0"
7373
placeholder={show_search_in_community
74-
? `Search in q/${$page.params.name}`
74+
? `Search in q/${page.params.name}`
7575
: 'Search...'}
7676
/>
7777
</label>

frontend/src/lib/components/post.svelte

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { page } from '$app/stores';
2+
import { page } from '$app/state';
33
import type { components } from '$lib/clients/v1/schema';
44
import Avatar from '$lib/components/ui/avatar.svelte';
55
import BackdropImage from '$lib/components/ui/backdrop_image.svelte';
@@ -30,11 +30,11 @@
3030
}
3131
3232
function get_avatar() {
33-
return $page.url.pathname.includes('/q/') ? post.poster.avatar : post.poster.avatar;
33+
return page.url.pathname.includes('/q/') ? post.poster.avatar : post.poster.avatar;
3434
}
3535
3636
function get_name() {
37-
return $page.url.pathname.includes('/q/')
37+
return page.url.pathname.includes('/q/')
3838
? `u/${post.poster.username}`
3939
: `q/${post.community.name}`;
4040
}

frontend/src/routes/(app)/q/+error.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { page } from '$app/stores';
2+
import { page } from '$app/state';
33
import Quibble404 from '$lib/assets/vectors/quibble_404.svg';
44
</script>
55

@@ -12,7 +12,7 @@
1212
<div class="flex flex-col">
1313
<h4 class="text-xl font-bold text-error">oh noh!!</h4>
1414
<!-- eslint-disable svelte/no-at-html-tags -->
15-
<h5>{@html $page.error?.message}</h5>
15+
<h5>{@html page.error?.message}</h5>
1616
<!-- eslint-enable svelte/no-at-html-tags -->
1717
<a href="/" aria-label="home" class="btn btn-primary btn-sm mt-4 w-max">
1818
<coreicons-shape-home class="size-4"></coreicons-shape-home>

frontend/src/routes/+error.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { page } from '$app/stores';
2+
import { page } from '$app/state';
33
import Quibble404 from '$lib/assets/vectors/quibble_404.svg';
44
</script>
55

@@ -11,7 +11,7 @@
1111
<img src={Quibble404} class="w-28" alt="" />
1212
<div class="flex flex-col">
1313
<h4 class="text-xl font-bold text-error">oops!!</h4>
14-
<h5>{$page.error?.message}</h5>
14+
<h5>{page.error?.message}</h5>
1515
<a href="/" aria-label="home" class="btn btn-primary btn-sm mt-4 w-max">
1616
<coreicons-shape-home class="size-4"></coreicons-shape-home>
1717
Back to home

0 commit comments

Comments
 (0)