-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.tsx
35 lines (31 loc) · 1012 Bytes
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Outlet, useLocation, useNavigate } from "@solidjs/router";
import { ErrorPage } from "../error";
import { EIconKind } from "../../ui-kit/icon";
import { DISCORD_LINK, debugStringify, logError } from "@fort-major/msq-shared";
import { createEffect } from "solid-js";
export function IndexPage() {
const location = useLocation();
const navigate = useNavigate();
createEffect(() => {
if (location.pathname === "/" || location.pathname === "/cabinet") {
navigate("/cabinet/my-assets");
}
});
try {
return <Outlet />;
} catch (e) {
logError(e);
return (
<ErrorPage
header="Houston, we have a problem"
text="Something unexpected just happened! Refresh the page to make it work again or consider reporting the error to us."
error={debugStringify(e)}
button={{
text: "Report the Error",
icon: EIconKind.ArrowRightUp,
action: () => window.open(DISCORD_LINK, "_blank"),
}}
/>
);
}
}