mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 06:28:51 +00:00
improve settings hook
This commit is contained in:
1 parent
362ab8be4d
commit
26cf051696
2 files changed
+18
-17
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import Default from "../default.json";
|
||||
import { useConfig } from "../../../config/hooks/useConfig";
|
||||
import { atom } from "recoil";
|
||||
import { createMuiTheme } from "@material-ui/core";
|
||||
|
||||
const settingsState = atom({
|
||||
key: "settings",
|
||||
@@ -9,5 +10,7 @@ const settingsState = atom({
|
||||
|
||||
export const useSettings = () => {
|
||||
const [settings, setSettings] = useConfig(settingsState);
|
||||
return { settings, setSettings };
|
||||
const [config] = useConfig();
|
||||
const currentTheme = () => createMuiTheme(config.themes[settings.theme]);
|
||||
return { settings, setSettings, currentTheme };
|
||||
};
|
||||
Reference in new issue
Block a user