diff --git a/packages/ui/src/routes/+layout.svelte b/packages/ui/src/routes/+layout.svelte index 7f46f6b54..640c8de4f 100644 --- a/packages/ui/src/routes/+layout.svelte +++ b/packages/ui/src/routes/+layout.svelte @@ -8,53 +8,22 @@ import { Toaster } from 'svelte-french-toast'; import { userStore } from '$lib/stores/user'; import type { LayoutData } from './$types'; - import { Link, Tooltip } from '$lib/components'; - import { IconEmail } from '$lib/icons'; import { page } from '$app/stores'; import { derived } from '@square/svelte-store'; import { onMount, setContext } from 'svelte'; import { goto } from '$app/navigation'; import { unsubscribe } from '$lib/utils'; import LinkProjectModal from './LinkProjectModal.svelte'; - import Breadcrumbs from './Breadcrumbs.svelte'; import ShareIssueModal from './ShareIssueModal.svelte'; import { SETTINGS_CONTEXT, loadUserSettings } from '$lib/userSettings'; import { initTheme } from '$lib/theme'; - import { install as installUpdate } from '$lib/updater'; - import { relaunch } from '@tauri-apps/api/process'; import { onUpdaterEvent } from '@tauri-apps/api/updater'; + import Header from './Header.svelte'; + import Footer from './Footer.svelte'; export let data: LayoutData; const { posthog, projects, sentry, cloud, update } = data; - const user = userStore; - - let updateStatus: { - error?: string; - status: 'PENDING' | 'DOWNLOADED' | 'ERROR' | 'DONE' | 'UPTODATE'; - }; - onMount(() => { - const unsubscribe = onUpdaterEvent((status) => { - updateStatus = status; - if (updateStatus.error) { - toasts.error(updateStatus.error); - } - }); - return () => unsubscribe.then((unsubscribe) => unsubscribe()); - }); - - let updateTimer: ReturnType; - onMount(() => { - update.load(); - const tenMinutes = 1000 * 60 * 10; - updateTimer = setInterval(() => { - update.reload?.(); - }, tenMinutes); - return () => { - () => clearInterval(updateTimer); - }; - }); - const userSettings = loadUserSettings(); initTheme(userSettings); setContext(SETTINGS_CONTEXT, userSettings); @@ -104,93 +73,19 @@ })); }), - user.subscribe(posthog.identify), - user.subscribe(sentry.identify) + userStore.subscribe(posthog.identify), + userStore.subscribe(sentry.identify) ) );
-
- -
-
- {#await user.load() then} - - {#if $user?.picture} - Avatar - {/if} - {$user?.name ?? 'Account'} - - {/await} -
-
- +
- - - - -
-
-
-
- {#if $project} - -
- {#if $project?.api?.sync} -
- online - {:else} -
- offline - {/if} -
- - {/if} -
- -
- {#if $update?.enabled && $update?.shouldUpdate} -
- {#if !updateStatus} -
- 1 -
- - {:else if updateStatus.status === 'PENDING'} - downloading update... - {:else if updateStatus.status === 'DOWNLOADED'} - installing update... - {:else if updateStatus.status === 'DONE'} - - {/if} -
- {/if} - -
- - events.emit('openSendIssueModal')} /> - -
-
-
-
-
+ +
diff --git a/packages/ui/src/routes/Footer.svelte b/packages/ui/src/routes/Footer.svelte new file mode 100644 index 000000000..d32730c6c --- /dev/null +++ b/packages/ui/src/routes/Footer.svelte @@ -0,0 +1,95 @@ + + + diff --git a/packages/ui/src/routes/Header.svelte b/packages/ui/src/routes/Header.svelte new file mode 100644 index 000000000..903205160 --- /dev/null +++ b/packages/ui/src/routes/Header.svelte @@ -0,0 +1,28 @@ + + +
+ +
+
+ + {#if user?.picture} + Avatar + {/if} + {user?.name ?? 'Account'} + +
+