Skip to content

Commit 85954ba

Browse files
committed
error page
1 parent d7828f7 commit 85954ba

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

pages/_error/+Page.client.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
// /pages/_error/+Page.ts
2-
31
import { h } from '@macrostrat/map-interface'
42
import { usePageContext } from 'vike-react/usePageContext'
3+
import "./main.styl"
4+
import { Image } from "../index"
5+
6+
function pageDoesntExist() {
7+
8+
9+
return h('div.error404', [
10+
h(Image, { src: "earth-crust.jpg", className: "error-image", width: "100%", height: "100%" }),
11+
h('div.error-text', [
12+
h('h1', "404"),
13+
h('h2', "The rock you are looking for doesn't exist. Keep digging."),
14+
])
15+
])
16+
}
517

618
export function Page() {
719
const pageContext = usePageContext()
@@ -23,9 +35,9 @@ export function Page() {
2335
} else {
2436
// Fallback error message
2537
msg = pageContext.is404 ?
26-
"This page doesn't exist." :
38+
pageDoesntExist() :
2739
"Something went wrong. Try again (later)."
2840
}
2941

30-
return h('h1', msg)
42+
return h('div.error', msg)
3143
}

0 commit comments

Comments
 (0)