Merge branch 'link-to-editor'
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
@ -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> </span>
|
<span> </span>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
@ -13,7 +20,10 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { page } from "$app/stores";
|
||||||
import "$lib/style/index.js";
|
import "$lib/style/index.js";
|
||||||
|
|
||||||
|
$: currentPath = $page.url.pathname;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@ -25,4 +35,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>
|
||||||
|
15
src/lib/components/MainLayout.test.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { readable } from "svelte/store";
|
||||||
|
import { test, expect, vi } from "vitest";
|
||||||
|
import { render } from "@testing-library/svelte";
|
||||||
|
|
||||||
|
vi.mock("$app/stores", () => ({
|
||||||
|
page: readable({ url: { pathname: "/" } }),
|
||||||
|
}));
|
||||||
|
|
||||||
|
import MainLayout from "./MainLayout.svelte";
|
||||||
|
|
||||||
|
test("we have an editor link", () => {
|
||||||
|
const { queryByText } = render(MainLayout);
|
||||||
|
|
||||||
|
expect(queryByText("Editor")).toBeTruthy();
|
||||||
|
});
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |