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,56 +1,68 @@
|
||||
import React from 'react';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import { fade, makeStyles, Theme } from '@material-ui/core/styles';
|
||||
import Avatar from '@material-ui/core/Avatar';
|
||||
import { green } from '@material-ui/core/colors';
|
||||
import { Badge, Button } from '@material-ui/core';
|
||||
import { Badge, Button, Tooltip, Zoom } from '@material-ui/core';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
interface IStyles {
|
||||
root: any;
|
||||
avatar: any;
|
||||
}
|
||||
|
||||
const useStyles = makeStyles(
|
||||
(theme): IStyles => ({
|
||||
const useStyles = makeStyles<Theme, { color: string; backgroundColor: string }>(
|
||||
(theme) => ({
|
||||
root: {
|
||||
display: 'flex',
|
||||
'& > *': {
|
||||
margin: theme.spacing(1),
|
||||
},
|
||||
padding: 0,
|
||||
marginTop: theme.spacing(3),
|
||||
},
|
||||
avatar: {
|
||||
'&:hover': {
|
||||
backgroundColor: ({ backgroundColor }) => fade(backgroundColor, 0.6),
|
||||
},
|
||||
backgroundColor: ({ backgroundColor }) => backgroundColor,
|
||||
color: ({ color }) => color,
|
||||
width: theme.spacing(7),
|
||||
height: theme.spacing(7),
|
||||
boxShadow: theme.shadows[2],
|
||||
width: theme.spacing(8),
|
||||
height: theme.spacing(8),
|
||||
fontSize: theme.typography.h4.fontSize,
|
||||
},
|
||||
tooltip: {
|
||||
fontSize: 12,
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
export const AppIcon = ({
|
||||
id,
|
||||
nameLocale,
|
||||
name,
|
||||
icon,
|
||||
backgroundColor,
|
||||
color,
|
||||
notification,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const classes = useStyles({
|
||||
backgroundColor: backgroundColor || green[50],
|
||||
color: color || green[400],
|
||||
});
|
||||
|
||||
return (
|
||||
<Button className={classes.root}>
|
||||
<Badge
|
||||
color="error"
|
||||
badgeContent={notification?.badge}
|
||||
invisible={!notification || notification.badge < 2}
|
||||
>
|
||||
<Avatar className={classes.avatar}>
|
||||
{icon || name[0].toUpperCase()}
|
||||
</Avatar>
|
||||
</Badge>
|
||||
</Button>
|
||||
<Tooltip
|
||||
arrow
|
||||
key={id}
|
||||
title={t(nameLocale)}
|
||||
placement='top'
|
||||
classes={{ tooltip: classes.tooltip }}
|
||||
TransitionComponent={Zoom}
|
||||
>
|
||||
<Button className={classes.root}>
|
||||
<Badge
|
||||
color='error'
|
||||
badgeContent={notification?.badge}
|
||||
invisible={!notification || notification.badge < 2}
|
||||
>
|
||||
<Avatar className={classes.avatar}>
|
||||
{icon || name[0].toUpperCase()}
|
||||
</Avatar>
|
||||
</Badge>
|
||||
</Button>
|
||||
</Tooltip>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user