This commit includes the temporary Next.js build cache files, public brand logos, and project configuration added in this change.
22 lines
714 B
XML
22 lines
714 B
XML
/**
|
|
* Inline script that runs in <head> before hydration.
|
|
*
|
|
* Reads the persisted theme id from localStorage and applies it to
|
|
* <html> so the user never sees a flash of the default theme.
|
|
*
|
|
* MUST stay dependency-free — it's bundled as a string and inlined.
|
|
*/
|
|
export function ThemeBootstrapScript() {
|
|
const code = `
|
|
(function() {
|
|
try {
|
|
var themeId = localStorage.getItem('wfdash-theme') || 'wfdash';
|
|
var root = document.documentElement;
|
|
root.setAttribute('data-theme', themeId);
|
|
} catch (e) {
|
|
// localStorage may be blocked — fall back to the SSR-rendered theme
|
|
}
|
|
})();
|
|
`;
|
|
return <script dangerouslySetInnerHTML={{ __html: code }} />;
|
|
}
|