refactor: move most routing logic to tanstack

This commit is contained in:
Prayag Prajapati committed 2024-05-29 18:10:22 +05:30
1 parent b8552ac35d
commit c22dbefeea
22 files changed
+1191 -1502

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
.server-error {
&-container {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
gap: 1em;
.material-symbols-rounded {
font-size: 10em;
// --wght: 500;
// --opsz: 40
}
}
}
+31 -2
View File
@@ -1,6 +1,35 @@
import { createFileRoute } from "@tanstack/react-router";
import { Link, createFileRoute, useNavigate } from "@tanstack/react-router";
import React from "react";
import "./server.error.scss";
import { Button, ButtonGroup, Typography } from "@mui/material";
import { relaunch } from "@tauri-apps/api/process";
export const Route = createFileRoute("/setup/server/error")({
component: () => <div>Hello /setup/server/error!</div>,
component: () => {
const navigate = useNavigate();
return (
<div className="scrollY server-error-container">
<span className="material-symbols-rounded fill gradient-text">
report
</span>
<Typography variant="h4">Unable to connect to server!</Typography>
<div className="flex flex-align-center" style={{ gap: "1em" }}>
<Button
variant="contained"
onClick={() => navigate({ to: "/setup/server/list" })}
>
Change Server
</Button>
<Button
variant="contained"
color="secondary"
onClick={async () => await relaunch()}
>
Restart Blink
</Button>
</div>
</div>
);
},
});