2023-05-28 22:54:17 +00:00
|
|
|
<template>
|
|
|
|
<div class="container">
|
|
|
|
<header class="header">
|
|
|
|
<a href="/">
|
|
|
|
<h1 class="title">
|
|
|
|
<div
|
|
|
|
class="logo"
|
|
|
|
v-html="logo"
|
|
|
|
/>shack
|
|
|
|
</h1>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<div class="search">
|
|
|
|
<input
|
|
|
|
type="search"
|
|
|
|
class="input"
|
|
|
|
placeholder="Search the shack"
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<span
|
2023-06-25 17:52:00 +00:00
|
|
|
v-if="me"
|
2023-05-28 22:54:17 +00:00
|
|
|
class="userpanel"
|
|
|
|
@click="logout"
|
2023-06-25 17:52:00 +00:00
|
|
|
>{{ me.username }}</span>
|
2023-05-28 22:54:17 +00:00
|
|
|
</header>
|
|
|
|
|
|
|
|
<div class="content-container">
|
|
|
|
<slot />
|
2023-06-05 23:30:46 +00:00
|
|
|
<footer class="footer">shack {{ version }}</footer>
|
2023-05-28 22:54:17 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
2023-06-11 03:32:02 +00:00
|
|
|
import logo from '../assets/img/logo.svg?raw'; // eslint-disable-line import/no-unresolved
|
2023-05-28 22:54:17 +00:00
|
|
|
import { del } from '../assets/js/api';
|
2023-06-25 17:52:00 +00:00
|
|
|
import { navigate } from '../assets/js/navigate';
|
2023-06-11 03:32:02 +00:00
|
|
|
import { usePageContext } from './usePageContext';
|
2023-05-28 22:54:17 +00:00
|
|
|
|
2023-06-25 17:52:00 +00:00
|
|
|
const { me } = usePageContext();
|
2023-05-28 22:54:17 +00:00
|
|
|
const version = CLIENT_VERSION;
|
|
|
|
|
|
|
|
async function logout() {
|
2023-06-25 17:52:00 +00:00
|
|
|
await del('/session');
|
|
|
|
navigate('/account/login');
|
2023-05-28 22:54:17 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.logo svg {
|
|
|
|
height: 100%;
|
|
|
|
width: auto;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.container {
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
background: var(--background-dark-10);
|
|
|
|
}
|
|
|
|
|
|
|
|
.content-container {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
flex-grow: 1;
|
|
|
|
overflow-y: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.header {
|
|
|
|
display: flex;
|
|
|
|
flex-shrink: 0;
|
|
|
|
background: var(--background);
|
|
|
|
box-shadow: 0 0 3px var(--shadow-weak-10);
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.logo {
|
|
|
|
width: auto;
|
|
|
|
height: 1.75rem;
|
|
|
|
fill: var(--primary);
|
|
|
|
margin: .75rem .5rem 1rem 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
|
|
|
font-size: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.search {
|
|
|
|
display: flex;
|
|
|
|
flex-grow: 1;
|
|
|
|
align-items: center;
|
|
|
|
margin: 0 1rem;
|
|
|
|
|
|
|
|
.input {
|
|
|
|
flex-grow: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.userpanel {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: 1rem;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.footer {
|
|
|
|
padding: .5rem 1rem;
|
|
|
|
color: var(--shadow);
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
</style>
|