close phone on ESC - thank me later Rocky

This commit is contained in:
itschip committed 2020-11-18 19:13:17 +01:00
1 parent d9c71203ac
commit a1e5876406
1 file changed
+9
+9
View File
@@ -21,6 +21,8 @@ import { useTwitterService } from "./apps/twitter/hooks/useTwitterService";
import { useSelloutService } from "./apps/sellout/hooks/useSelloutService";
import { useBankService } from './apps/bank/hooks/useBankService';
import { useNotesService } from "./apps/notes/hooks/useNotesService";
import { usePhone } from "./os/phone/hooks/usePhone";
import Nui from "./os/nui-events/utils/Nui";
//These events are just for testing. Comment it out before building.
setTimeout(() => {
@@ -223,6 +225,7 @@ setTimeout(() => {
function Phone() {
useNuiService();
const { } = usePhone()
const { visibility } = usePhoneService();
const { settings, currentTheme } = useSettings();
const { allApps } = useApps();
@@ -240,6 +243,12 @@ function Phone() {
const calling = false;
document.onkeyup = function(data) {
if (data.which == 27) {
Nui.send("phone:close");
}
}
return (
<ThemeProvider theme={currentTheme()}>
<div className="PhoneWrapper">