Skip to content

Commit

Permalink
feat: create top-level wrapper route components
Browse files Browse the repository at this point in the history
  • Loading branch information
Fariz Rizaldy committed Jan 13, 2020
1 parent 6f5964c commit 5e689f5
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
48 changes: 48 additions & 0 deletions src/routes/_error.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<script>
import Container from '../components/Container'
export let status
export let error
const dev = process.env.NODE_ENV === 'development'
</script>

<style>
h1,
p {
margin: 0 auto;
}
h1 {
font-size: 2.8em;
font-weight: 700;
margin: 0 0 0.5em 0;
}
p {
font-size: 2rem;
margin: 1em auto;
}
@media (min-width: 480px) {
h1 {
font-size: 4em;
}
}
</style>

<svelte:head>
<title>{status} - {error.message}</title>
</svelte:head>

<Container>
<h1>{status}</h1>

<p>{error.message}. But we have trace this, thank you.</p>

<a href="/">Back to home</a>

{#if dev && error.stack}
<pre>{error.stack}</pre>
{/if}
</Container>
8 changes: 8 additions & 0 deletions src/routes/_layout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script>
import Navbar from '../components/Navbar'
</script>

<main>
<slot />
<Navbar />
</main>

0 comments on commit 5e689f5

Please sign in to comment.