add link to editor

This commit is contained in:
Yanick Champoux 2023-04-16 12:23:13 -04:00
parent 5f18ce9fe9
commit 0c2f12f91b
2 changed files with 31 additions and 1 deletions

View File

@ -4,7 +4,14 @@
<a>The Docks</a> <a>The Docks</a>
</h1> </h1>
<h3 class="max">a Full Thrust ship builder</h3> <h3 class="max">a Full Thrust ship builder</h3>
<a>About</a> <div class="tabs in left-align">
<a class="spaced" class:active={currentPath === "/"} href="/">Editor</a>
<a
class="spaced"
class:active={currentPath.startsWith("/about")}
href="/about">About</a
>
</div>
<span>&nbsp;</span> <span>&nbsp;</span>
</nav> </nav>
</header> </header>
@ -13,7 +20,11 @@
</main> </main>
<script> <script>
import { page } from "$app/stores";
import "$lib/style/index.js"; import "$lib/style/index.js";
$: currentPath = $page.url.pathname;
$: console.log({ currentPath });
</script> </script>
<style> <style>
@ -25,4 +36,13 @@
font-size: var(--font-scale-12); font-size: var(--font-scale-12);
font-weight: normal; font-weight: normal;
} }
a.spaced {
min-width: 5em;
}
span {
width: 5em;
}
.tabs {
border-bottom: 0px;
}
</style> </style>

View File

@ -0,0 +1,10 @@
import { test, expect } from "vitest";
import { render } from "@testing-library/svelte";
import MainLayout from "./MainLayout.svelte";
test("we have an editor link", () => {
const { queryByText } = render(MainLayout);
expect(queryByText("Editor")).toBeTruthy();
});