mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Notification alert stays on if it is an incoming call and phone is closed (#115)
* Phone now shows all the time slide a bit if incoming call exists | can close alerts! * Improve animation * Improve call controls * Make alerts not overflow | Call modal is navigable out :) * Open modal when accepting call * Cant navigate back from homepage * Avoid call route if no call active + rename things * Impprove main apps icons sizes * hover effect to app icons :) * Revert interface change * fix(phone/dialer): resolve not calling when adding contacts Co-authored-by: Christopher <[email protected]>
This commit is contained in:
1 parent
d2461bab16
commit
41674968ab
24 files changed
+396
-206
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Box, makeStyles } from '@material-ui/core';
|
||||
import CloseIcon from '@material-ui/icons/Close';
|
||||
import { Box, IconButton, makeStyles, Slide } from '@material-ui/core';
|
||||
import { useNotifications } from '../hooks/useNotifications';
|
||||
import { Alert, AlertTitle } from '@material-ui/lab';
|
||||
|
||||
@@ -11,6 +12,11 @@ const useStyles = makeStyles((theme) => ({
|
||||
alignItems: 'center',
|
||||
},
|
||||
alert: {
|
||||
'& .MuiAlert-action': {
|
||||
top: theme.spacing(1),
|
||||
right: theme.spacing(2),
|
||||
position: 'absolute',
|
||||
},
|
||||
position: 'relative',
|
||||
cursor: 'pointer',
|
||||
width: '370px',
|
||||
@@ -22,6 +28,16 @@ const useStyles = makeStyles((theme) => ({
|
||||
color: theme.palette.text.primary,
|
||||
},
|
||||
},
|
||||
alertContent: {
|
||||
display: '-webkit-box',
|
||||
maxWidth: '360px',
|
||||
height: '60px',
|
||||
margin: '0 auto',
|
||||
'-webkit-line-clamp': 3,
|
||||
'-webkit-box-orient': 'vertical',
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
},
|
||||
}));
|
||||
|
||||
export const NotificationAlert = () => {
|
||||
@@ -30,17 +46,37 @@ export const NotificationAlert = () => {
|
||||
|
||||
return (
|
||||
<div className={classes.snackbar}>
|
||||
{currentAlert ? (
|
||||
<Slide in={!!currentAlert} mountOnEnter unmountOnExit>
|
||||
<Alert
|
||||
onClick={() => currentAlert.onClick?.(currentAlert)}
|
||||
icon={currentAlert.icon || false}
|
||||
action={
|
||||
<IconButton
|
||||
color='primary'
|
||||
size='small'
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
currentAlert?.onCloseAlert(e);
|
||||
}}
|
||||
>
|
||||
<CloseIcon fontSize='small' />
|
||||
</IconButton>
|
||||
}
|
||||
onClick={(e) => currentAlert?.onClickAlert(e)}
|
||||
icon={currentAlert?.icon || false}
|
||||
className={classes.alert}
|
||||
elevation={6}
|
||||
>
|
||||
<AlertTitle>{currentAlert.title}</AlertTitle>
|
||||
<Box width='100%'>{currentAlert.content}</Box>
|
||||
<AlertTitle>
|
||||
<Box width='282px' whiteSpace='nowrap'>
|
||||
<Box overflow='hidden' component='div' textOverflow='ellipsis'>
|
||||
{currentAlert?.title}
|
||||
</Box>
|
||||
</Box>
|
||||
</AlertTitle>
|
||||
<Box component='div' className={classes.alertContent}>
|
||||
{currentAlert?.content}
|
||||
</Box>
|
||||
</Alert>
|
||||
) : null}
|
||||
</Slide>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user