Add loading indicator for admin asset initialization

Introduced a "loading" div to indicate when admin assets are being fetched. Updated rendering logic and styles in related components to account for this state. Prepared groundwork for potential view transitions.
This commit is contained in:
dswbx
2025-01-10 18:04:40 +01:00
parent bb756548a6
commit c7d983942f
5 changed files with 71 additions and 21 deletions

View File

@@ -10,7 +10,10 @@ function ClientApp() {
// Render the app
const rootElement = document.getElementById("app")!;
if (!rootElement.innerHTML) {
const shouldRender =
!rootElement.innerHTML ||
(rootElement.childElementCount === 1 && rootElement.firstElementChild?.id === "loading");
if (shouldRender) {
const root = ReactDOM.createRoot(rootElement);
root.render(
<React.StrictMode>