-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b781bb
commit 0d58c68
Showing
9 changed files
with
168 additions
and
172 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,69 +1,50 @@ | ||
import { AlertDialog } from "@kobalte/core"; | ||
import { A } from "@solidjs/router"; | ||
import * as pkg from "~/../package.json"; | ||
import { JSXElement, Show, mergeProps } from "solid-js"; | ||
|
||
type Props = { | ||
error: unknown; | ||
title?: JSXElement; | ||
children: JSXElement; | ||
}; | ||
|
||
export function ErrorDialog(props: Props) { | ||
export function ErrorDialog(p: Props) { | ||
const props = mergeProps({ title: "Alert" }, p); | ||
|
||
return ( | ||
<> | ||
<div class="surf-container"> | ||
<img class="bg-surface static" src="/bg.jpeg" aria-hidden /> | ||
</div> | ||
<div class="p-28 grid grid-rows-[auto_1fr_auto] gap-5 h-screen text-neutral-400 "> | ||
<header> | ||
<h1 class="text-red-400 font-semibold text-6xl"> | ||
Irrecoverable Error | ||
</h1> | ||
<div class="text-3xl pt-8"> | ||
<p>Something terrible happened.</p> | ||
<p>The log is on the way and we'll work on it!</p> | ||
</div> | ||
</header> | ||
<article class="flex flex-col justify-evenly"> | ||
<div class="p-5 border-2 border-slate-800 rounded-lg font-mono"> | ||
<h2 class="text-4xl relative -top-12">System log</h2> | ||
<pre class="text-2xl"> | ||
{props.error?.toString() || String(props.error)} | ||
</pre> | ||
<ul class="pt-12"> | ||
<li>App version: {pkg.version}</li> | ||
<li>Browser: {window.navigator.userAgent}</li> | ||
</ul> | ||
</div> | ||
<div class="flex gap-10"> | ||
<A | ||
href="/" | ||
class="border border-red-400 hover:bg-red-700 hover:border-red-900 text-white text-lg py-2 px-4 rounded focus:outline-dashed focus:outline-white focus:outline-offset-2 focus:outline-1" | ||
> | ||
Reset App | ||
</A> | ||
<button | ||
onClick={() => { | ||
window.location.reload(); | ||
}} | ||
class="border border-neutral-400 hover:bg-neutral-800 hover:border-neutral-100 text-white text-lg py-2 px-4 rounded focus:outline-dashed focus:outline-white focus:outline-offset-2" | ||
> | ||
Reload Route | ||
</button> | ||
</div> | ||
</article> | ||
<aside> | ||
<p class="text-3xl"> | ||
Feel free to reach us at the{" "} | ||
<a | ||
href="https://discord.gg/tauri" | ||
rel="noreferrer noopener" | ||
target="_blank" | ||
class="text-white focus:outline-none focus:underline focus:decoration-dotted focus:underline-offset-2" | ||
> | ||
Tauri Discord: #CrabNebula | ||
</a> | ||
. | ||
</p> | ||
</aside> | ||
</div> | ||
</> | ||
<AlertDialog.Root defaultOpen modal preventScroll> | ||
{/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion*/} | ||
<AlertDialog.Portal mount={document.getElementById("app")!}> | ||
<AlertDialog.Overlay class="fixed h-screen w-screen grid place-items-center backdrop-blur-md z-50 top-0 left-0" /> | ||
<div class="fixed inset-0 z-50 flex items-center justify-center text-xl"> | ||
<AlertDialog.Content class="z-50 text-4xl max-w-prose md:max-w-96 border border-neutral-800 rounded-lg p-10 bg-navy-700 bg-opacity-80 shadow-lg shadow-navy-600 kb-expanded:animate-content-show kb-disabled:animate-content-hide"> | ||
<div class="flex items-baseline justify-between mb-3"> | ||
<Show when={props.title}>{props.title}</Show> | ||
</div> | ||
<AlertDialog.Description class="text-base text-neutral-300"> | ||
{props.children} | ||
</AlertDialog.Description> | ||
<div class="pt-8 flex gap-10 justify-center"> | ||
<AlertDialog.CloseButton | ||
class="border border-neutral-400 hover:bg-neutral-800 hover:border-neutral-100 text-white text-lg py-2 px-4 rounded focus:outline-dashed focus:outline-white focus:outline-offset-2" | ||
onClick={() => { | ||
window.location.reload(); | ||
}} | ||
> | ||
Reload route | ||
</AlertDialog.CloseButton> | ||
<AlertDialog.CloseButton class="border border-neutral-400 hover:bg-neutral-800 hover:border-neutral-100 text-white text-lg py-2 px-4 rounded focus:outline-dashed focus:outline-white focus:outline-offset-2"> | ||
Dismiss | ||
</AlertDialog.CloseButton> | ||
<A | ||
href="/" | ||
class="bg-red-400 border border-red-400 hover:bg-red-700 hover:border-red-900 text-white text-lg py-2 px-4 rounded focus:outline-dashed focus:outline-white focus:outline-offset-2" | ||
> | ||
Reset App | ||
</A> | ||
</div> | ||
</AlertDialog.Content> | ||
</div> | ||
</AlertDialog.Portal> | ||
</AlertDialog.Root> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { A } from "@solidjs/router"; | ||
import * as pkg from "~/../package.json"; | ||
|
||
type Props = { | ||
error: unknown; | ||
}; | ||
|
||
export function ErrorRoot(props: Props) { | ||
return ( | ||
<> | ||
<div class="surf-container"> | ||
<img class="bg-surface static" src="/bg.jpeg" aria-hidden /> | ||
</div> | ||
<div class="p-28 grid grid-rows-[auto_1fr_auto] gap-5 h-screen text-neutral-400 "> | ||
<header> | ||
<h1 class="text-red-400 font-semibold text-6xl"> | ||
Irrecoverable Error | ||
</h1> | ||
<div class="text-3xl pt-8"> | ||
<p>Something terrible happened.</p> | ||
<p>The log is on the way and we'll work on it!</p> | ||
</div> | ||
</header> | ||
<article class="flex flex-col justify-evenly"> | ||
<div class="p-5 border-2 border-slate-800 rounded-lg font-mono"> | ||
<h2 class="text-4xl relative -top-12">System log</h2> | ||
<pre class="text-2xl"> | ||
{props.error?.toString() || String(props.error)} | ||
</pre> | ||
<ul class="pt-12"> | ||
<li>App version: {pkg.version}</li> | ||
<li>Browser: {window.navigator.userAgent}</li> | ||
</ul> | ||
</div> | ||
<div class="flex gap-10"> | ||
<A | ||
href="/" | ||
class="border border-red-400 hover:bg-red-700 hover:border-red-900 text-white text-lg py-2 px-4 rounded focus:outline-dashed focus:outline-white focus:outline-offset-2 focus:outline-1" | ||
> | ||
Reset App | ||
</A> | ||
<button | ||
onClick={() => { | ||
window.location.reload(); | ||
}} | ||
class="border border-neutral-400 hover:bg-neutral-800 hover:border-neutral-100 text-white text-lg py-2 px-4 rounded focus:outline-dashed focus:outline-white focus:outline-offset-2" | ||
> | ||
Reload Route | ||
</button> | ||
</div> | ||
</article> | ||
<aside> | ||
<p class="text-3xl"> | ||
Feel free to reach us at the{" "} | ||
<a | ||
href="https://discord.gg/tauri" | ||
rel="noreferrer noopener" | ||
target="_blank" | ||
class="text-white focus:outline-none focus:underline focus:decoration-dotted focus:underline-offset-2" | ||
> | ||
Tauri Discord: #CrabNebula | ||
</a> | ||
. | ||
</p> | ||
</aside> | ||
</div> | ||
</> | ||
); | ||
} |
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
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
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
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
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
Oops, something went wrong.