-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add email compose option and refine layout
- Loading branch information
Showing
5 changed files
with
95 additions
and
64 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,46 +1,63 @@ | ||
import { Chrome } from '../components/PageElements'; | ||
|
||
export default function Error({ error, children }) { | ||
return ( | ||
<article className=""> | ||
<div className="p-10"> | ||
<h2 className="my-0 text-indigo-600">This is a little embarrassing...</h2> | ||
<p className="mt-10"> | ||
There was an error in the application that caused it to crash. Here are some technical details.{' '} | ||
<span role="img" aria-label="nerd emoji"> | ||
🤓 | ||
</span> | ||
<article> | ||
<Chrome> | ||
<h2 className="text-indigo-600">This is a little embarrassing...</h2> | ||
<p> | ||
We are really sorry. There was an error in the application that caused it to crash. The best way to make this | ||
not happen again for you or anyone else is to report the issue to us. It should only take a few moments. | ||
</p> | ||
{error && error.message ? ( | ||
<> | ||
<label htmlFor="message">Error message:</label> | ||
<pre id="message" className="overflow-auto text-base text-gray-400">{`${error.message}`}</pre> | ||
</> | ||
) : null} | ||
{error && error.stack ? ( | ||
<> | ||
<label htmlFor="stack">Stack trace:</label> | ||
<pre id="stack" className="overflow-auto text-base text-gray-400">{`${error.stack}`}</pre> | ||
</> | ||
) : null} | ||
{error && !error.message && !error.stack ? ( | ||
<pre className="overflow-auto text-base text-gray-400">{error.toString()}</pre> | ||
) : null} | ||
<div className="flex justify-between"> | ||
{window.ugrc ? ( | ||
<h2 className="mb-8 text-center">Report by</h2> | ||
<section className="grid grid-cols-2 gap-4 mb-8 text-center"> | ||
<div className="px-3 py-2 border rounded"> | ||
<h3 className="mt-0">GitHub account</h3> | ||
<button type="button" onClick={() => window.ugrc.openIssue({ message: error.message, stack: error.stack })}> | ||
Let's go | ||
</button> | ||
</div> | ||
<div className="px-3 py-2 border rounded"> | ||
<h3 className="mt-0">Email</h3> | ||
<button type="button" onClick={() => window.ugrc.openEmail({ message: error.message, stack: error.stack })}> | ||
Compose | ||
</button> | ||
</div> | ||
</section> | ||
<h2 className="mb-8 text-center text-indigo-600">Thank you so much!</h2> | ||
{children || ( | ||
<p> | ||
You may now{' '} | ||
<button className="font-bold text-yellow-500 hover:text-yellow-300" onClick={window.ugrc.relaunchApp}> | ||
restart the application | ||
</button>{' '} | ||
and try geocoding again. | ||
</p> | ||
)} | ||
<details className="mt-6"> | ||
<summary> | ||
<span role="img" aria-label="nerd emoji"> | ||
🤓 | ||
</span>{' '} | ||
Technical Details | ||
</summary> | ||
{error && error.message ? ( | ||
<> | ||
<button type="button" onClick={window.ugrc.relaunchApp}> | ||
Restart application | ||
</button> | ||
<button | ||
type="button" | ||
onClick={() => window.ugrc.openIssue({ message: error.message, stack: error.stack })} | ||
> | ||
Report this issue | ||
</button> | ||
<label htmlFor="message">Error message:</label> | ||
<pre id="message" className="overflow-auto text-base text-gray-400">{`${error.message}`}</pre> | ||
</> | ||
) : null} | ||
</div> | ||
{children} | ||
</div> | ||
{error && error.stack ? ( | ||
<> | ||
<label htmlFor="stack">Stack trace:</label> | ||
<pre id="stack" className="overflow-auto text-base text-gray-400">{`${error.stack}`}</pre> | ||
</> | ||
) : null} | ||
{error && !error.message && !error.stack ? ( | ||
<pre className="overflow-auto text-base text-gray-400">{error.toString()}</pre> | ||
) : null} | ||
</details> | ||
</Chrome> | ||
</article> | ||
); | ||
} |
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