Skip to content

Commit 4e6fa4a

Browse files
committed
add 404
1 parent 9bed6c3 commit 4e6fa4a

File tree

3 files changed

+84
-50
lines changed

3 files changed

+84
-50
lines changed

src/routes/about/+page.svelte

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
<div class="container mx-auto flex flex-col p-3">
2-
<h1 class="text-3xl">About</h1>
3-
Coming soon
4-
</div>
1+
<script lang="ts">
2+
import Play from '$lib/components/play.svelte';
3+
import { page } from '$app/state';
4+
import { preferencesStore } from '$lib/stores.js';
5+
import { Button } from '$lib/components/ui/button/index.js';
6+
</script>
7+
8+
{#if $preferencesStore.experimentalFeatures}
9+
<div class="container mx-auto flex flex-col p-3">
10+
<h1 class="text-3xl">About</h1>
11+
Coming soon
12+
</div>
13+
{:else}
14+
<div class="flex h-full flex-col items-center justify-center gap-3">
15+
<span class="text-6xl">404</span>
16+
<span class="text-3xl">Not Found</span>
17+
<Button variant="outline" href="/">Go home</Button>
18+
</div>
19+
{/if}

src/routes/backups/+page.svelte

Lines changed: 54 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import Info from '@lucide/svelte/icons/info';
1919
import * as Alert from '$lib/components/ui/alert/index.js';
2020
import posthog from 'posthog-js';
21+
import { preferencesStore } from '$lib/stores.js';
2122
2223
// let query = $state(useQuery(api.backups.get, { jwt: '' }));
2324
// const client = useConvexClient();
@@ -40,52 +41,53 @@
4041
}
4142
</script>
4243

43-
<div class="mx-auto flex w-full max-w-3xl flex-col gap-3 p-3">
44-
<h1 class="text-3xl">Backups</h1>
45-
<AlertDialog.Root open={loading}
46-
><AlertDialog.Content class="flex flex-row gap-3">
47-
<LoaderCircle class="animate-spin" />
48-
Loading
49-
</AlertDialog.Content>
50-
</AlertDialog.Root>
44+
{#if $preferencesStore.experimentalFeatures}
45+
<div class="mx-auto flex w-full max-w-3xl flex-col gap-3 p-3">
46+
<h1 class="text-3xl">Backups</h1>
47+
<AlertDialog.Root open={loading}
48+
><AlertDialog.Content class="flex flex-row gap-3">
49+
<LoaderCircle class="animate-spin" />
50+
Loading
51+
</AlertDialog.Content>
52+
</AlertDialog.Root>
5153

52-
<Card.Root>
53-
<Card.Header><Card.Title>Local Backup</Card.Title></Card.Header>
54-
<Card.Content class="flex flex-col gap-3">
55-
Export
56-
<div class="flex flex-row gap-3">
57-
<Input disabled={true} value={backupData} />
58-
<Button
59-
size="icon"
60-
onclick={() => {
61-
posthog.capture('backup', { type: 'copy', location: 'local' });
62-
navigator.clipboard
63-
.writeText(backupData)
64-
.then(() => {
65-
toast.success('Backup copied to clipboard');
66-
})
67-
.catch((error) => {
68-
toast.error('Failed to copy backup to clipboard');
69-
});
70-
}}><Clipboard /></Button
71-
>
72-
</div>
73-
Import
74-
<div class="flex flex-row gap-3">
75-
<Input bind:value={inputtedBackupData} />
76-
<Button
77-
disabled={inputtedBackupData.length === 0}
78-
onclick={() => {
79-
posthog.capture('backup', { type: 'import', location: 'local' });
80-
loading = true;
81-
restoreBackup(inputtedBackupData);
82-
}}>Import</Button
83-
>
84-
</div>
85-
</Card.Content>
86-
</Card.Root>
54+
<Card.Root>
55+
<Card.Header><Card.Title>Local Backup</Card.Title></Card.Header>
56+
<Card.Content class="flex flex-col gap-3">
57+
Export
58+
<div class="flex flex-row gap-3">
59+
<Input disabled={true} value={backupData} />
60+
<Button
61+
size="icon"
62+
onclick={() => {
63+
posthog.capture('backup', { type: 'copy', location: 'local' });
64+
navigator.clipboard
65+
.writeText(backupData)
66+
.then(() => {
67+
toast.success('Backup copied to clipboard');
68+
})
69+
.catch((error) => {
70+
toast.error('Failed to copy backup to clipboard');
71+
});
72+
}}><Clipboard /></Button
73+
>
74+
</div>
75+
Import
76+
<div class="flex flex-row gap-3">
77+
<Input bind:value={inputtedBackupData} />
78+
<Button
79+
disabled={inputtedBackupData.length === 0}
80+
onclick={() => {
81+
posthog.capture('backup', { type: 'import', location: 'local' });
82+
loading = true;
83+
restoreBackup(inputtedBackupData);
84+
}}>Import</Button
85+
>
86+
</div>
87+
</Card.Content>
88+
</Card.Root>
8789

88-
<!-- <SignedIn>
90+
<!-- <SignedIn>
8991
<div class="grid w-full grid-cols-1 gap-3 md:grid-cols-2">
9092
<Card.Root>
9193
<Card.Header><Card.Title>Create a Backup</Card.Title></Card.Header>
@@ -137,4 +139,11 @@
137139
></Alert.Root
138140
>
139141
</SignedOut> -->
140-
</div>
142+
</div>
143+
{:else}
144+
<div class="flex h-full flex-col items-center justify-center gap-3">
145+
<span class="text-6xl">404</span>
146+
<span class="text-3xl">Not Found</span>
147+
<Button variant="outline" href="/">Go home</Button>
148+
</div>
149+
{/if}

src/routes/g/+page.svelte

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
import DataTable from './data-table.svelte';
33
import { columns } from './columns.js';
44
import { gmaes } from '$lib/gmaes';
5+
import { preferencesStore } from '$lib/stores.js';
6+
import Button from '$lib/components/ui/button/button.svelte';
57
</script>
68

7-
<DataTable data={gmaes} {columns} />
9+
{#if $preferencesStore.experimentalFeatures}
10+
<DataTable data={gmaes} {columns} />
11+
{:else}
12+
<div class="flex h-full flex-col items-center justify-center gap-3">
13+
<span class="text-6xl">404</span>
14+
<span class="text-3xl">Not Found</span>
15+
<Button variant="outline" href="/">Go home</Button>
16+
</div>
17+
{/if}

0 commit comments

Comments
 (0)