2026-05-11 21:02:24 +12:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { createEventDispatcher } from 'svelte';
|
|
|
|
|
import Icon from '$lib/components/Icon.svelte';
|
|
|
|
|
|
|
|
|
|
export let email = '';
|
|
|
|
|
|
|
|
|
|
const dispatch = createEventDispatcher<{ logout: void }>();
|
|
|
|
|
|
|
|
|
|
let loggingOut = false;
|
|
|
|
|
|
|
|
|
|
async function logout() {
|
|
|
|
|
loggingOut = true;
|
|
|
|
|
try {
|
|
|
|
|
const token = window.localStorage.getItem('gw_onboarding_session') ?? '';
|
|
|
|
|
if (token) {
|
|
|
|
|
await fetch('/api/auth/logout', {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
headers: { Authorization: `Bearer ${token}` },
|
|
|
|
|
}).catch(() => { /* ignore network errors on logout */ });
|
|
|
|
|
}
|
|
|
|
|
} finally {
|
|
|
|
|
try { window.localStorage.removeItem('gw_onboarding_session'); } catch { /* ignore */ }
|
|
|
|
|
loggingOut = false;
|
|
|
|
|
dispatch('logout');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<footer class="ob-footer">
|
|
|
|
|
<div class="ob-footer-inner">
|
2026-05-12 00:45:02 +12:00
|
|
|
<a href="https://goodwalk.co.nz" class="ob-footer-back">
|
|
|
|
|
<Icon name="fas fa-arrow-left" />
|
|
|
|
|
Back to main site
|
|
|
|
|
</a>
|
2026-05-15 01:28:10 +12:00
|
|
|
{#if email}
|
|
|
|
|
<span class="ob-footer-email">Signed in as {email}</span>
|
|
|
|
|
{/if}
|
|
|
|
|
<button type="button" class="ob-footer-logout" on:click={logout} disabled={loggingOut}>
|
2026-05-11 21:02:24 +12:00
|
|
|
<Icon name="fas fa-right-from-bracket" />
|
|
|
|
|
{loggingOut ? 'Signing out…' : 'Sign out'}
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</footer>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.ob-footer {
|
|
|
|
|
background: #213021;
|
|
|
|
|
margin-top: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.ob-footer-inner {
|
|
|
|
|
max-width: 1120px;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
padding: 0 28px;
|
|
|
|
|
height: 52px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
gap: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-12 00:45:02 +12:00
|
|
|
.ob-footer-back {
|
|
|
|
|
display: inline-flex;
|
2026-05-11 21:02:24 +12:00
|
|
|
align-items: center;
|
|
|
|
|
gap: 8px;
|
2026-05-12 00:45:02 +12:00
|
|
|
font-family: var(--font-head);
|
2026-05-11 21:02:24 +12:00
|
|
|
font-size: 13px;
|
2026-05-12 00:45:02 +12:00
|
|
|
font-weight: 700;
|
|
|
|
|
color: rgba(255, 255, 255, 0.65);
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
transition: color 0.15s;
|
2026-05-11 21:02:24 +12:00
|
|
|
}
|
|
|
|
|
|
2026-05-12 00:45:02 +12:00
|
|
|
.ob-footer-back:hover {
|
|
|
|
|
color: #fff;
|
2026-05-11 21:02:24 +12:00
|
|
|
}
|
|
|
|
|
|
2026-05-15 01:28:10 +12:00
|
|
|
.ob-footer-email {
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
min-width: 0;
|
|
|
|
|
color: rgba(255, 255, 255, 0.62);
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-11 21:02:24 +12:00
|
|
|
.ob-footer-logout {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 7px;
|
|
|
|
|
padding: 7px 14px;
|
|
|
|
|
border-radius: 999px;
|
|
|
|
|
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
|
|
|
background: transparent;
|
|
|
|
|
font-family: var(--font-head);
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
color: rgba(255, 255, 255, 0.7);
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: background 0.15s, color 0.15s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.ob-footer-logout:hover {
|
|
|
|
|
background: rgba(255, 255, 255, 0.1);
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
|
.ob-footer-inner {
|
|
|
|
|
padding: 0 18px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|