-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from vikejs/phonzammi-dev
chore: refactor
- Loading branch information
Showing
17 changed files
with
768 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
export default function Page(props: { is404: boolean; errorInfo?: string }) { | ||
if (props.is404) { | ||
return ( | ||
<> | ||
<h1>404 Page Not Found</h1> | ||
<p>This page could not be found.</p> | ||
<p>{props.errorInfo}</p> | ||
</> | ||
); | ||
} else { | ||
return ( | ||
<> | ||
<h1>500 Internal Server Error</h1> | ||
<p>Something went wrong.</p> | ||
</> | ||
); | ||
} | ||
import { Show } from "solid-js"; | ||
import { usePageContext } from "vike-solid/usePageContext"; | ||
|
||
export default function Page() { | ||
const { is404 } = usePageContext() | ||
|
||
return ( | ||
<Show | ||
when={is404} | ||
fallback={ | ||
<> | ||
<h1>500 Internal Server Error</h1> | ||
<p>Something went wrong.</p> | ||
</> | ||
} | ||
> | ||
<h1>404 Page Not Found</h1> | ||
<p>This page could not be found.</p> | ||
</Show> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
export default function Page(props: { is404: boolean; errorInfo?: string }) { | ||
if (props.is404) { | ||
return ( | ||
<> | ||
<h1>404 Page Not Found</h1> | ||
<p>This page could not be found.</p> | ||
<p>{props.errorInfo}</p> | ||
</> | ||
); | ||
} else { | ||
return ( | ||
<> | ||
<h1>500 Internal Server Error</h1> | ||
<p>Something went wrong.</p> | ||
</> | ||
); | ||
} | ||
import { Show } from "solid-js"; | ||
import { usePageContext } from "vike-solid/usePageContext"; | ||
|
||
export default function Page() { | ||
const { is404 } = usePageContext() | ||
|
||
return ( | ||
<Show | ||
when={is404} | ||
fallback={ | ||
<> | ||
<h1>500 Internal Server Error</h1> | ||
<p>Something went wrong.</p> | ||
</> | ||
} | ||
> | ||
<h1>404 Page Not Found</h1> | ||
<p>This page could not be found.</p> | ||
</Show> | ||
); | ||
} |
Oops, something went wrong.