Skip to content

Commit 6323111

Browse files
committed
Moved navigation to its own component.
1 parent 9b7becf commit 6323111

File tree

2 files changed

+35
-30
lines changed

2 files changed

+35
-30
lines changed

src/routes/+layout.svelte

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { initFlash } from 'sveltekit-flash-message/client';
33
import { page } from '$app/stores';
44
import { beforeNavigate } from '$app/navigation';
5+
import Navigation from './Navigation.svelte';
56
67
const flash = initFlash(page);
78
@@ -19,31 +20,7 @@
1920
<div style:background-color={bg} class="flash">{$flash.message}</div>
2021
{/if}
2122

22-
<nav>
23-
<a href="/">Start</a> |
24-
<a href="/test">Test page</a> |
25-
<a href="/crud">CRUD</a> |
26-
<a href="/super-debug">SuperDebug</a> |
27-
<a href="/nested">Nested</a> |
28-
<a href="/multiple">Multiple</a> |
29-
<br />
30-
<a href="/multiple2">Multiple 2</a>
31-
<a href="/snapshot">Snapshot</a> |
32-
<a href="/dates">Dates</a> |
33-
<a href="/reset">Reset</a> |
34-
<a href="/url">URL</a> |
35-
<a href="/tainted">Tainted</a> |
36-
<a href="/proxies">Proxies</a>
37-
<br />
38-
<a href="/properly-nested">Properly nested</a>
39-
<a href="/files">Files</a> |
40-
<a href="/spa">SPA</a> |
41-
<a href="/nested-validation">Client-side validation</a> |
42-
<a href="/tests/rex">Side-effect validation</a>
43-
<br />
44-
<a href="/tests/superform-c">Side-effect 2</a> |
45-
<a href="/tests/multiselect">Multi-select</a>
46-
</nav>
23+
<Navigation />
4724

4825
<slot />
4926

@@ -53,9 +30,4 @@
5330
color: white;
5431
border-radius: 3px;
5532
}
56-
57-
nav {
58-
text-align: center;
59-
margin-bottom: 12px;
60-
}
6133
</style>

src/routes/Navigation.svelte

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<nav>
2+
<a href="/">Start</a> |
3+
<a href="/test">Test page</a> |
4+
<a href="/crud">CRUD</a> |
5+
<a href="/super-debug">SuperDebug</a> |
6+
<a href="/nested">Nested</a> |
7+
<a href="/multiple">Multiple</a> |
8+
<br />
9+
<a href="/multiple2">Multiple 2</a>
10+
<a href="/snapshot">Snapshot</a> |
11+
<a href="/dates">Dates</a> |
12+
<a href="/reset">Reset</a> |
13+
<a href="/url">URL</a> |
14+
<a href="/tainted">Tainted</a> |
15+
<a href="/proxies">Proxies</a>
16+
<br />
17+
<a href="/properly-nested">Properly nested</a>
18+
<a href="/files">Files</a> |
19+
<a href="/spa">SPA</a> |
20+
<a href="/nested-validation">Client-side validation</a> |
21+
<a href="/tests/rex">Side-effect validation</a>
22+
<br />
23+
<a href="/tests/superform-c">Side-effect 2</a> |
24+
<a href="/tests/multiselect">Multi-select</a> |
25+
<a href="/tests/spa-values-disappearing">SPA onUpdate</a>
26+
</nav>
27+
28+
<style>
29+
nav {
30+
text-align: center;
31+
margin-bottom: 12px;
32+
}
33+
</style>

0 commit comments

Comments
 (0)