mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
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:
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;
|
||||
Reference in new issue
Block a user