Feat: Settings localStorage state

This commit is contained in:
Taso committed 2021-01-12 12:04:46 -05:00
commit 73a5bab1c7
15 files changed
+120 -122

No files matched your search

+10 -4
View File
@@ -2,11 +2,10 @@ import React from 'react';
import './Phone.css';
import './i18n';
import { Route } from 'react-router-dom';
import { useSettings } from './apps/settings/hooks/useSettings';
import MessageIcon from '@material-ui/icons/Email';
import { CallModal } from './modal/components/CallModal';
import { HomeApp } from './apps/home/components/Home';
import { ThemeProvider } from '@material-ui/core';
import { createMuiTheme, ThemeProvider } from '@material-ui/core';
import { useInitKeyboard } from './os/keyboard/hooks/useKeyboard';
import { NotificationIcon } from './os/notifications/components/NotificationIcon';
import { NotificationBar } from './os/notifications/components/NotificationBar';
@@ -25,6 +24,10 @@ import { useNotesService } from './apps/notes/hooks/useNotesService';
import { usePhotoService } from './apps/camera/hooks/usePhotoService';
import Nui from './os/nui-events/utils/Nui';
import { usePhone } from './os/phone/hooks/usePhone';
import { settingsState } from './apps/settings/hooks/useSettings';
import config from './config/default.json';
import { useRecoilState } from 'recoil';
// Inject mock data when in development env.
if (process.env.NODE_ENV === 'development') {
@@ -245,7 +248,6 @@ function Phone() {
useNuiService();
usePhoneService();
const { visibility } = usePhone();
const { settings, currentTheme } = useSettings();
const { allApps } = useApps();
useSimcardService();
useContactsService();
@@ -257,10 +259,14 @@ function Phone() {
useNotesService();
usePhotoService();
const [settings] = useRecoilState(settingsState);
if (visibility === false) {
return null;
}
const currentTheme = () => createMuiTheme(config.themes[settings.theme]);
const calling = false;
document.onkeyup = function (data) {
@@ -279,7 +285,7 @@ function Phone() {
style={{
backgroundImage: `url(./media/frames/${settings.frame})`,
}}
></div>
/>
<div
id='phone'
className='PhoneScreen'