2020-04-23 14:32:36 +02:00
|
|
|
<script>
|
2020-11-18 20:18:18 +01:00
|
|
|
import { getContext } from "svelte"
|
|
|
|
|
2020-11-20 10:50:10 +01:00
|
|
|
const { authStore, linkable, styleable } = getContext("sdk")
|
2020-11-24 12:02:10 +01:00
|
|
|
const component = getContext("component")
|
2020-11-12 13:24:45 +01:00
|
|
|
|
2020-04-23 14:32:36 +02:00
|
|
|
export let logoUrl
|
|
|
|
|
2020-10-14 21:12:41 +02:00
|
|
|
const logOut = () => {
|
2020-11-12 13:27:53 +01:00
|
|
|
authStore.actions.logOut()
|
2020-10-14 21:12:41 +02:00
|
|
|
}
|
2020-04-23 14:32:36 +02:00
|
|
|
</script>
|
|
|
|
|
2020-11-24 12:02:10 +01:00
|
|
|
<div class="nav" use:styleable={$component.styles}>
|
2020-10-14 18:06:02 +02:00
|
|
|
<div class="nav__top">
|
2020-11-17 13:08:24 +01:00
|
|
|
<a href="/" use:linkable>
|
2020-10-14 18:06:02 +02:00
|
|
|
{#if logoUrl}
|
|
|
|
<img class="logo" alt="logo" src={logoUrl} height="48" />
|
|
|
|
{/if}
|
|
|
|
</a>
|
|
|
|
<div class="nav__controls">
|
2020-10-14 21:12:41 +02:00
|
|
|
<div on:click={logOut}>Log out</div>
|
2020-10-14 18:06:02 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-11-13 16:42:32 +01:00
|
|
|
<div class="nav__menu">
|
|
|
|
<slot />
|
|
|
|
</div>
|
2020-10-14 18:06:02 +02:00
|
|
|
</div>
|
2020-04-23 14:32:36 +02:00
|
|
|
|
|
|
|
<style>
|
2020-10-14 18:06:02 +02:00
|
|
|
.nav {
|
2020-04-23 14:32:36 +02:00
|
|
|
display: flex;
|
2020-10-14 18:06:02 +02:00
|
|
|
flex-direction: column;
|
|
|
|
justify-content: flex-start;
|
|
|
|
align-items: stretch;
|
2020-04-23 14:32:36 +02:00
|
|
|
}
|
|
|
|
|
2020-10-14 18:06:02 +02:00
|
|
|
.nav__top {
|
2020-04-23 14:32:36 +02:00
|
|
|
display: flex;
|
2020-10-14 18:06:02 +02:00
|
|
|
flex-direction: row;
|
|
|
|
justify-content: space-between;
|
2020-04-23 14:32:36 +02:00
|
|
|
align-items: center;
|
|
|
|
}
|
2020-10-14 18:06:02 +02:00
|
|
|
.nav__top img {
|
2020-07-12 20:19:12 +02:00
|
|
|
margin-right: 16px;
|
2020-04-23 14:32:36 +02:00
|
|
|
}
|
2020-10-14 18:06:02 +02:00
|
|
|
|
|
|
|
.nav__controls {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: flex-end;
|
|
|
|
align-items: center;
|
|
|
|
gap: 16px;
|
|
|
|
}
|
|
|
|
.nav__controls > div:hover {
|
|
|
|
cursor: pointer;
|
|
|
|
color: #4285f4;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav__menu {
|
2020-04-23 14:32:36 +02:00
|
|
|
display: flex;
|
2020-10-14 18:06:02 +02:00
|
|
|
margin-top: 40px;
|
|
|
|
gap: 16px;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: flex-start;
|
|
|
|
align-items: center;
|
2020-04-23 14:32:36 +02:00
|
|
|
}
|
2020-10-14 18:06:02 +02:00
|
|
|
.nav__menu > a {
|
|
|
|
font-size: 1.5em;
|
|
|
|
text-decoration: none;
|
2020-04-23 14:32:36 +02:00
|
|
|
}
|
|
|
|
</style>
|