feat(Phone): add animation

This commit is contained in:
Christopher committed 2021-02-15 00:30:01 +01:00
1 parent e51bcca7f8
commit 31e692626a
1 file changed
+4 -4
+4 -4
View File
@@ -5,7 +5,7 @@ import { Route } from 'react-router-dom';
import { CallModal } from './modal/components/CallModal'; import { CallModal } from './modal/components/CallModal';
import { Alert } from './ui/components/Alert'; import { Alert } from './ui/components/Alert';
import { HomeApp } from './apps/home/components/Home'; import { HomeApp } from './apps/home/components/Home';
import { createMuiTheme, ThemeProvider } from '@material-ui/core'; import { createMuiTheme, ThemeProvider, Slide} from '@material-ui/core';
import { useInitKeyboard } from './os/keyboard/hooks/useKeyboard'; import { useInitKeyboard } from './os/keyboard/hooks/useKeyboard';
import { NotificationIcon } from './os/notifications/components/NotificationIcon'; import { NotificationIcon } from './os/notifications/components/NotificationIcon';
import { NotificationBar } from './os/notifications/components/NotificationBar'; import { NotificationBar } from './os/notifications/components/NotificationBar';
@@ -66,9 +66,7 @@ function Phone() {
[settings.theme] [settings.theme]
); );
if (visibility === false) {
return null;
}
document.onkeyup = function (data) { document.onkeyup = function (data) {
if (data.which === 27) { if (data.which === 27) {
Nui.send('phone:close'); Nui.send('phone:close');
@@ -77,6 +75,7 @@ function Phone() {
return ( return (
<ThemeProvider theme={currentTheme}> <ThemeProvider theme={currentTheme}>
<Slide direction='up' in={visibility} mountOnEnter unmountOnExit>
<div className='PhoneWrapper'> <div className='PhoneWrapper'>
<div> <div>
<div <div
@@ -141,6 +140,7 @@ function Phone() {
</div> </div>
</div> </div>
</div> </div>
</Slide>
</ThemeProvider> </ThemeProvider>
); );
} }