all repos — emessage @ 0cbb6ef61f1c6f3f3a199c14add57b3daed63684

The EMessage email client

frontend/src/routes/+layout.svelte (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
<script lang="ts">
	import './layout.css';
	import ControlButton       from '$lib/components/ControlButton.svelte';
	import SearchBar           from '$lib/components/SearchBar.svelte';
	import ConversationPreview from '$lib/components/ConversationPreview.svelte';
	import NoConversation      from '$lib/components/NoConversation.svelte';
	import settingsIcon from '$lib/assets/icons/settings.svg?raw';
	import newIcon      from '$lib/assets/icons/new.svg?raw';
	import { goto } from "$app/navigation";
	import { GetUserContact } from "$lib/wailsjs/go/main/App";
	import { global } from "$lib/global.svelte.js";

	let { children } = $props();
	let conversations = [];

	const userContact = await GetUserContact();
	global.contact = userContact;
	
</script>

<svelte:head>
</svelte:head>
<main class="flex w-[100vw] h-[100vh] text-primary">
	<nav class="bg-sidebar w-1/4 h-full">
		<section class="flex flex-col gap-2 p-2">
			<div class="flex justify-end gap-4">
				<ControlButton icon={settingsIcon}
							   onclick={() => goto("/settings")} />
				<ControlButton icon={newIcon}
							   onclick={() => goto("/")}/>
			</div>
			<SearchBar />
		</section>
		<ol class="p-2">
			{#each conversations as conversation}
				<li><ConversationPreview {conversation} /></li>
			{:else}
				<NoConversation />
			{/each}
		</ol>
	</nav>
	<section class="w-full h-full">
		{@render children()}
	</section>
</main>