mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Feat: Settings localStorage state
This commit is contained in:
commit
73a5bab1c7
15 files changed
+120
-122
No files matched your search
+10
-4
@@ -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'
|
||||
|
||||
Reference in new issue
Block a user