mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
Refactor admin theme handling and optimize initialization.
Simplified theme detection logic and improved the loading screen for better performance on slower networks. Adjusted styles, reorganized imports, and removed unnecessary rendering logic in `main.tsx`.
This commit is contained in:
@@ -1,26 +1,13 @@
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom/client";
|
||||
import Admin from "./Admin";
|
||||
import "./main.css";
|
||||
|
||||
import Admin from "./Admin";
|
||||
|
||||
function ClientApp() {
|
||||
return <Admin withProvider />;
|
||||
}
|
||||
|
||||
// Render the app
|
||||
const rootElement = document.getElementById("app")!;
|
||||
const shouldRender =
|
||||
!rootElement.innerHTML ||
|
||||
(rootElement.childElementCount === 1 && rootElement.firstElementChild?.id === "loading");
|
||||
if (shouldRender) {
|
||||
const root = ReactDOM.createRoot(rootElement);
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<ClientApp />
|
||||
</React.StrictMode>
|
||||
);
|
||||
}
|
||||
ReactDOM.createRoot(document.getElementById("root")!).render(
|
||||
<React.StrictMode>
|
||||
<Admin withProvider />
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
// REGISTER ERROR OVERLAY
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
|
||||
Reference in New Issue
Block a user