mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-10-04 11:50:09 +00:00
Dark UI for react-select
This commit is contained in:
@@ -40,6 +40,8 @@ export const ThemeProvider: React.FC<ThemeProviderProps> = ({ children }) => {
|
||||
|
||||
useEffect(() => {
|
||||
document.body.dataset.theme = theme;
|
||||
document.body.classList.remove(theme === Light ? Dark : Light);
|
||||
document.body.classList.add(theme);
|
||||
localStorage.setItem(StorageKey, theme);
|
||||
}, [theme]);
|
||||
|
||||
@@ -53,7 +55,7 @@ export const ThemeProvider: React.FC<ThemeProviderProps> = ({ children }) => {
|
||||
|
||||
const getTheme = () => {
|
||||
return theme;
|
||||
}
|
||||
};
|
||||
|
||||
document.documentElement.setAttribute("data-bs-theme", theme);
|
||||
return <ThemeContext.Provider value={{ theme, toggleTheme, setTheme, getTheme }}>{children}</ThemeContext.Provider>;
|
||||
|
Reference in New Issue
Block a user