INNER CODE UNIT · JavaScript
isDark
open-source-labs/Swell · src/index.js:65
const isDark = useSelector((state) => state.ui.isDark);
// Determine the theme based on the isDark state
const theme = isDark ? darkTheme : lightTheme;
return (
<ThemeProvider theme={theme}>
<CssBaseline />
<App />
</ThemeProvider>
);
}
/**
* TODO: Find a way to parse nonce and add it to the MUI cache so 'unsafe-inline' can also be removed
* TODO: Randomly generate nonce on app launch (within index.js?)
* * Currently nonce is generated once per build via Webpack per previous Teams -- may be an issue when building exe/dmg for distribution
* * Due to the nature of Electron.js -- not using backend to generate nonce per request