mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Feature / Add working notifications with only twitter for now (#102)
* Add working notifications with only twitter for now * feat(notification-bar): I didnt copy from NP * Make default browser visibility true * feat(notifications): Collapse when no more notifications after closing one
This commit is contained in:
1 parent
11af8bfb5a
commit
40ec19a349
19 files changed
+497
-153
No files matched your search
+41
-47
@@ -5,9 +5,8 @@ import { Route } from 'react-router-dom';
|
||||
import { CallModal } from './modal/components/CallModal';
|
||||
import { Alert } from './ui/components/Alert';
|
||||
import { HomeApp } from './apps/home/components/Home';
|
||||
import { createMuiTheme, ThemeProvider, Slide} from '@material-ui/core';
|
||||
import { createMuiTheme, ThemeProvider, Slide } 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';
|
||||
import { Navigation } from './os/navigation-bar/components/Navigation';
|
||||
import { useNuiService } from './os/nui-events/hooks/useNuiService';
|
||||
@@ -23,25 +22,34 @@ import { useMessagesService } from './apps/messages/hooks/useMessageService';
|
||||
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 { useSettings } from './apps/settings/hooks/useSettings';
|
||||
|
||||
import config from './config/default.json';
|
||||
import { useRecoilState } from 'recoil';
|
||||
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';
|
||||
import { useSnackbar } from './ui/hooks/useSnackbar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { usePhoneVisibility } from './os/phone/hooks/usePhoneVisibility';
|
||||
|
||||
function Phone() {
|
||||
const quickAccess = useQuickAccess();
|
||||
const { t } = useTranslation();
|
||||
const { alert } = useSnackbar();
|
||||
const { modal } = useModal();
|
||||
const { allApps } = useApps();
|
||||
|
||||
const [settings] = useSettings();
|
||||
|
||||
const {
|
||||
bottom,
|
||||
visibility,
|
||||
uncollapseNotifications,
|
||||
clickEventOverride,
|
||||
} = usePhoneVisibility();
|
||||
|
||||
useNuiService();
|
||||
usePhoneService();
|
||||
const { visibility } = usePhone();
|
||||
const { allApps } = useApps();
|
||||
useSimcardService();
|
||||
useContactsService();
|
||||
useTwitterService();
|
||||
@@ -53,20 +61,12 @@ function Phone() {
|
||||
usePhotoService();
|
||||
useCallService();
|
||||
useDialService();
|
||||
const { t } = useTranslation()
|
||||
|
||||
const { alert } = useSnackbar();
|
||||
|
||||
const { modal } = useModal(); // the calling modal
|
||||
|
||||
const [settings] = useRecoilState(settingsState);
|
||||
|
||||
const currentTheme = useMemo(
|
||||
() => createMuiTheme(config.themes[settings.theme]),
|
||||
[settings.theme]
|
||||
);
|
||||
|
||||
|
||||
document.onkeyup = function (data) {
|
||||
if (data.which === 27) {
|
||||
Nui.send('phone:close');
|
||||
@@ -79,10 +79,12 @@ function Phone() {
|
||||
<div className='PhoneWrapper'>
|
||||
<div>
|
||||
<div
|
||||
onClick={clickEventOverride}
|
||||
className='Phone'
|
||||
style={{
|
||||
transformOrigin: 'right bottom',
|
||||
transform: `scale(${settings.zoom}`,
|
||||
bottom,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
@@ -99,40 +101,32 @@ function Phone() {
|
||||
}}
|
||||
>
|
||||
<>
|
||||
<NotificationBar
|
||||
notifications={quickAccess.map((qa) => ({
|
||||
key: qa.id,
|
||||
icon: (
|
||||
<NotificationIcon
|
||||
icon={qa.notificationIcon}
|
||||
to={qa.path}
|
||||
/>
|
||||
),
|
||||
}))}
|
||||
/>
|
||||
<NotificationBar forceUncollapse={uncollapseNotifications} />
|
||||
<div className='PhoneAppContainer'>
|
||||
{modal ? (
|
||||
<CallModal />
|
||||
) : (
|
||||
<>
|
||||
<Route exact path='/' component={HomeApp} />
|
||||
{allApps.map((App) => (
|
||||
<App.Route key={App.id} />
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
{alert ? (
|
||||
<div style={{
|
||||
{modal ? (
|
||||
<CallModal />
|
||||
) : (
|
||||
<>
|
||||
<Route exact path='/' component={HomeApp} />
|
||||
{allApps.map((App) => (
|
||||
<App.Route key={App.id} />
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
{alert ? (
|
||||
<div
|
||||
style={{
|
||||
marginTop: '-100px',
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center'
|
||||
}}>
|
||||
<Alert severity={alert.type} variant="filled">
|
||||
{t("APPS_"+alert.message)}
|
||||
</Alert>
|
||||
</div>
|
||||
) : null}
|
||||
alignItems: 'center',
|
||||
}}
|
||||
>
|
||||
<Alert severity={alert.type} variant='filled'>
|
||||
{t('APPS_' + alert.message)}
|
||||
</Alert>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
<Navigation />
|
||||
</>
|
||||
|
||||
Reference in new issue
Block a user