mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Use recoil for state management
This commit is contained in:
1 parent
7a46eaf2be
commit
d8f756b309
10 files changed
+63
-49
No files matched your search
@@ -1,14 +1,18 @@
|
||||
import React, { createContext, useEffect } from "react";
|
||||
import React, { useEffect } from "react";
|
||||
import { useConfig } from "../../../config/hooks/useConfig";
|
||||
import { blue, grey } from "@material-ui/core/colors";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import ContactsIcon from "@material-ui/icons/Contacts";
|
||||
import SettingsIcon from '@material-ui/icons/Settings'
|
||||
import { atom } from "recoil";
|
||||
|
||||
const AppsContext = createContext(null);
|
||||
const appsState = atom({
|
||||
key: 'apps',
|
||||
default: null
|
||||
});
|
||||
|
||||
export const useApps = () => {
|
||||
const [apps, setApps] = useConfig(AppsContext);
|
||||
const [apps, setApps] = useConfig(appsState);
|
||||
const { t } = useTranslation();
|
||||
useEffect(() => {
|
||||
setApps("preinstalled", [
|
||||
|
||||
Reference in new issue
Block a user