mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 06:28:51 +00:00
Fix NUI every render (#75)
This commit is contained in:
1 parent
1d3a17220a
commit
e2c8964b81
1 file changed
+7
-5
+7
-5
@@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
import './Phone.css';
|
||||
import './i18n';
|
||||
import { Route } from 'react-router-dom';
|
||||
@@ -62,12 +62,14 @@ function Phone() {
|
||||
|
||||
const [settings] = useRecoilState(settingsState);
|
||||
|
||||
const currentTheme = useMemo(
|
||||
() => createMuiTheme(config.themes[settings.theme]),
|
||||
[settings.theme]
|
||||
);
|
||||
|
||||
if (visibility === false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const currentTheme = () => createMuiTheme(config.themes[settings.theme]);
|
||||
|
||||
document.onkeyup = function (data) {
|
||||
if (data.which === 27) {
|
||||
Nui.send('phone:close');
|
||||
@@ -75,7 +77,7 @@ function Phone() {
|
||||
};
|
||||
|
||||
return (
|
||||
<ThemeProvider theme={currentTheme()}>
|
||||
<ThemeProvider theme={currentTheme}>
|
||||
<div className='PhoneWrapper'>
|
||||
<div>
|
||||
<div
|
||||
|
||||
Reference in new issue
Block a user