feat: improve

This commit is contained in:
2024-04-10 14:11:05 +07:00
parent 5e6692cd6d
commit c342daecc8
26 changed files with 992 additions and 789 deletions

View File

@@ -1,9 +1,5 @@
import { LoaderIcon } from "@lume/icons";
import {
Outlet,
ScrollRestoration,
createRootRouteWithContext,
} from "@tanstack/react-router";
import { Outlet, createRootRouteWithContext } from "@tanstack/react-router";
import { type Ark } from "@lume/ark";
import { type QueryClient } from "@tanstack/react-query";
import { type Platform } from "@tauri-apps/plugin-os";
@@ -12,20 +8,15 @@ import { Account, Interests, Settings } from "@lume/types";
interface RouterContext {
ark: Ark;
queryClient: QueryClient;
platform: Platform;
locale: string;
settings: Settings;
interests: Interests;
accounts: Account[];
platform?: Platform;
locale?: string;
settings?: Settings;
interests?: Interests;
accounts?: Account[];
}
export const Route = createRootRouteWithContext<RouterContext>()({
component: () => (
<>
<ScrollRestoration />
<Outlet />
</>
),
component: () => <Outlet />,
pendingComponent: Pending,
wrapInSuspense: true,
});
@@ -33,7 +24,9 @@ export const Route = createRootRouteWithContext<RouterContext>()({
function Pending() {
return (
<div className="flex h-screen w-screen flex-col items-center justify-center">
<LoaderIcon className="size-5 animate-spin" />
<button type="button" className="size-5" disabled>
<LoaderIcon className="size-5 animate-spin" />
</button>
</div>
);
}