tweak(phone/call-modal): Tweaked appearance of call modal (#178)

Correct actions will now display if calling another player.

Also added ringing flavor text when the person calling is the transmitter.
This commit is contained in:
Taso authored and GitHub committed 2021-04-03 18:02:47 -04:00
1 parent 4bf3248168
commit 8ca8b1b5fe
15 files changed
+248 -136

No files matched your search

@@ -0,0 +1,48 @@
import React from 'react';
import { Avatar, Box, Typography } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles';
import { useContacts } from '../../../apps/contacts/hooks/useContacts';
import { useCall } from '../hooks/useCall';
import { useTranslation } from 'react-i18next';
const useStyles = makeStyles({
image: {
width: 80,
height: 80,
},
});
const CallContactContainer = () => {
const { t } = useTranslation();
const { call } = useCall();
const classes = useStyles();
const { getDisplayByNumber, getPictureByNumber } = useContacts();
const getDisplayOrNumber = () =>
call.isTransmitter ? getDisplayByNumber(call?.receiver) : getDisplayByNumber(call?.transmitter);
return (
<Box display="flex" alignItems="center">
<Box style={{ flexGrow: 1 }}>
<Typography variant="body1">
{call.isTransmitter
? t('CALLS.MESSAGES.OUTGOING').toUpperCase()
: t('CALLS.MESSAGES.INCOMING').toUpperCase()}
</Typography>
<Typography variant="h4">{getDisplayOrNumber()}</Typography>
</Box>
<Avatar
className={classes.image}
alt={getDisplayOrNumber()}
src={
call.isTransmitter
? getPictureByNumber(call.receiver)
: getPictureByNumber(call?.transmitter)
}
/>
</Box>
);
};
export default CallContactContainer;