Add quick access and improve Apps config

This commit is contained in:
J Francisco Rader committed 2021-02-08 00:44:57 -05:00
1 parent 6ae60b377c
commit c149a1f49e
5 files changed
+115 -26

No files matched your search

+13 -7
View File
@@ -1,8 +1,7 @@
import React, { useMemo } from 'react';
import './Phone.css';
import './i18n';
import { Route } from 'react-router-dom';
import MessageIcon from '@material-ui/icons/Email';
import { Route, useHistory } from 'react-router-dom';
import { CallModal } from './modal/components/CallModal';
import { HomeApp } from './apps/home/components/Home';
import { createMuiTheme, ThemeProvider } from '@material-ui/core';
@@ -32,6 +31,7 @@ import { useCallService } from './modal/hooks/useCallService';
import { useModal } from './modal/hooks/useModal';
import { useDialService } from './apps/dialer/hooks/useDialService';
import InjectDebugData from './os/debug/InjectDebugData';
import { useQuickAccess } from './os/notifications/hooks/useQuickAccess';
InjectDebugData([
{
@@ -42,6 +42,8 @@ InjectDebugData([
]);
function Phone() {
const history = useHistory();
const quickAccess = useQuickAccess();
useNuiService();
usePhoneService();
const { visibility } = usePhone();
@@ -103,10 +105,15 @@ function Phone() {
<>
<NotificationBar
notifications={[
{
key: 'newMessage',
icon: <NotificationIcon Icon={MessageIcon} />,
},
...quickAccess.map((qa) => ({
key: qa.id,
icon: (
<NotificationIcon
icon={qa.notificationIcon}
onClick={() => history.push(qa.path)}
/>
),
})),
]}
/>
<div className='PhoneAppContainer'>
@@ -115,7 +122,6 @@ function Phone() {
) : (
<>
<Route exact path='/' component={HomeApp} />
{allApps.map((App) => (
<App.Route key={App.id} />
))}