chore(mui): swap remaining admin-spinner loaders for kit LoadingState
Replace the three remaining hand-written admin-loading/admin-spinner markup blocks with the kit <LoadingState /> component: - AdminApp.tsx Suspense fallback - AppShell.tsx loading branch - PlanGrid.tsx no-data branch (plan-* classes untouched) After this the only remaining admin-* classes in TSX are admin-rich-editor (RichEditor/Quill) and admin-rich-text-view (sanitized HTML in Order/Invoice detail). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import ErrorBoundary from "./components/ErrorBoundary";
|
||||
import AppShell from "./ui/AppShell";
|
||||
import AlertContainer from "./components/AlertContainer";
|
||||
import MuiProvider from "./ui/MuiProvider";
|
||||
import { LoadingState } from "./ui";
|
||||
import Login from "./pages/Login";
|
||||
import Dashboard from "./pages/Dashboard";
|
||||
import "./variables.css";
|
||||
@@ -90,13 +91,7 @@ export default function AdminApp() {
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<AlertContainer />
|
||||
<ErrorBoundary>
|
||||
<Suspense
|
||||
fallback={
|
||||
<div className="admin-loading">
|
||||
<div className="admin-spinner" />
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<Suspense fallback={<LoadingState />}>
|
||||
<Routes>
|
||||
<Route path="login" element={<Login />} />
|
||||
{import.meta.env.DEV && UiKit && (
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
} from "../lib/queries/plan";
|
||||
import type { Project } from "../lib/queries/projects";
|
||||
import PlanRangeChips from "./PlanRangeChips";
|
||||
import { LoadingState } from "../ui";
|
||||
|
||||
interface Props {
|
||||
data: GridData | undefined;
|
||||
@@ -107,12 +108,7 @@ export default function PlanGrid({
|
||||
const today = useMemo(() => todayIso(), []);
|
||||
const catMap = useMemo(() => categoryMap(categories), [categories]);
|
||||
|
||||
if (!data)
|
||||
return (
|
||||
<div className="admin-loading">
|
||||
<div className="admin-spinner" />
|
||||
</div>
|
||||
);
|
||||
if (!data) return <LoadingState />;
|
||||
const days = eachDay(data.date_from, data.date_to);
|
||||
const users = data.users;
|
||||
// pulseKey?.nonce is included in the data-pulse attribute so a second
|
||||
|
||||
@@ -9,6 +9,7 @@ import { useAuth } from "../context/AuthContext";
|
||||
import ThemeToggle from "./ThemeToggle";
|
||||
import { setLogoutAlert } from "../utils/api";
|
||||
import SidebarNav from "./SidebarNav";
|
||||
import LoadingState from "./LoadingState";
|
||||
import ShortcutsHelp from "../components/ShortcutsHelp";
|
||||
|
||||
const DRAWER_WIDTH = 248;
|
||||
@@ -38,7 +39,7 @@ export default function AppShell() {
|
||||
bgcolor: "background.default",
|
||||
}}
|
||||
>
|
||||
<div className="admin-spinner" />
|
||||
<LoadingState />
|
||||
</Box>
|
||||
</ScopedCssBaseline>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user