Skip to content

Commit

Permalink
feat: pending component (doesnt seem to fix the initial page load loa…
Browse files Browse the repository at this point in the history
…ding view tho)
  • Loading branch information
Sampiiiii committed Apr 16, 2024
1 parent f4f72b3 commit 6296e17
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions apps/forge/src/components/routing/Loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Title from "@/components/title";
import React from "react";
import { Loader } from "@ui/components/ui/loader.tsx";

export const Loading = () => {
return (
<React.Fragment>
<Title prompt="Loading..." />
<div className="flex items-center justify-center w-full min-h-[80vh] px-4">
<div className="grid items-center gap-4 text-center">
<div className="space-y-2">
<Loader />
</div>
</div>
</div>
</React.Fragment>
);
};
2 changes: 2 additions & 0 deletions apps/forge/src/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import React, { Suspense } from "react";
import { AuthContext } from "@/components/auth-provider";
import { NotFound } from "@/components/routing/NotFound.tsx";
import { GenericError } from "@/components/routing/GenericError.tsx";
import { Loading } from "@/components/routing/Loading.tsx";

const TanStackRouterDevtools =
process.env.NODE_ENV === "production"
Expand Down Expand Up @@ -38,4 +39,5 @@ export const Route = createRootRouteWithContext<{
component: RootComponent,
notFoundComponent: NotFound,
errorComponent: GenericError,
pendingComponent: Loading,
});

0 comments on commit 6296e17

Please sign in to comment.