Prettified Code!

This commit is contained in:
itschip authored and GitHub Action committed 2021-01-17 21:17:56 +00:00
1 parent c8882a618b
commit 7cc3a47f7b
1 file changed
+23 -20
+23 -20
View File
@@ -12,50 +12,53 @@ import Nui from '../../os/nui-events/utils/Nui';
export const CallModal = () => { export const CallModal = () => {
const { call } = useCall(); const { call } = useCall();
const { setModal } = useModal() const { setModal } = useModal();
const classes = useStyles() const classes = useStyles();
const handleAcceptCall = () => { const handleAcceptCall = () => {
Nui.send('phone:acceptCall', { Nui.send('phone:acceptCall', {
phoneNumber: call.phone_number phoneNumber: call.phone_number,
}) });
} };
const handleRejectCall = () => { const handleRejectCall = () => {
setModal(false) setModal(false);
} };
const handleEndCall = () => { const handleEndCall = () => {
setModal(false) setModal(false);
} };
return ( return (
<AppWrapper> <AppWrapper>
<AppContent> <AppContent>
<h1 style={{ textAlign: 'center' }}>{call.transmitter ? call.target : call.caller}</h1> <h1 style={{ textAlign: 'center' }}>
{call.transmitter ? call.target : call.caller}
</h1>
<div className={classes.actions}> <div className={classes.actions}>
{!call.accepted ? ( {!call.accepted ? (
<> <>
<Fab <Fab
onClick={handleRejectCall} onClick={handleRejectCall}
style={{ backgroundColor: '#e74c3c', color: '#fff' }} style={{ backgroundColor: '#e74c3c', color: '#fff' }}
className={classes.actionButton}> className={classes.actionButton}
>
<CallEndIcon /> <CallEndIcon />
</Fab> </Fab>
<Fab <Fab
onClick={handleAcceptCall} onClick={handleAcceptCall}
style={{ backgroundColor: '#27ae60', color: '#fff' }} style={{ backgroundColor: '#27ae60', color: '#fff' }}
className={classes.actionButton} className={classes.actionButton}
> >
<CallIcon /> <CallIcon />
</Fab> </Fab>
</> </>
) : ( ) : (
<Fab <Fab
onClick={handleEndCall} onClick={handleEndCall}
style={{ backgroundColor: '#e74c3c', color: '#fff' }} style={{ backgroundColor: '#e74c3c', color: '#fff' }}
className={classes.actionButton} className={classes.actionButton}
> >
<CallEndIcon /> <CallEndIcon />