Phase 2 of the "fully MUI" cleanup — eliminates two more stylesheets.
- base.css -> src/admin/GlobalStyles.tsx: the reset, typography,
scrollbar/::selection, theme cross-fade timing and all utility
classes now live in a single theme-aware MUI <GlobalStyles>, rendered
inside MuiProvider so every rule resolves against theme.vars (verified
reactive in both schemes). base.css deleted.
- attendance.css -> a styled("div") LocationMap in AttendanceLocation;
attendance.css deleted.
- App.tsx bootstrap loader is now fully self-contained (inline spinner
+ keyframes, theme-aware background read from the data-theme attr),
since it renders before MuiProvider/GlobalStyles mount — it no longer
depends on the removed .admin-spinner / var(--bg-primary).
tsc -b --noEmit and npm run build clean; verified in Chrome (light +
dark): body bg, text, fonts, .text-warning/.link-accent all correct.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
19 lines
685 B
TypeScript
19 lines
685 B
TypeScript
import type { ReactNode } from "react";
|
|
import { ThemeProvider } from "@mui/material/styles";
|
|
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
|
|
import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFns";
|
|
import { cs } from "date-fns/locale";
|
|
import { theme } from "../theme";
|
|
import AppGlobalStyles from "../GlobalStyles";
|
|
|
|
export default function MuiProvider({ children }: { children: ReactNode }) {
|
|
return (
|
|
<ThemeProvider theme={theme} defaultMode="dark">
|
|
<AppGlobalStyles />
|
|
<LocalizationProvider dateAdapter={AdapterDateFns} adapterLocale={cs}>
|
|
{children}
|
|
</LocalizationProvider>
|
|
</ThemeProvider>
|
|
);
|
|
}
|