Prettified Code!

This commit is contained in:
itschip authored and GitHub Action committed 2021-01-26 20:43:20 +00:00
1 parent a7f3f50f3d
commit dbcfdd9eda
2 files changed
+11 -17

No files matched your search

+8 -13
View File
@@ -17,7 +17,7 @@ export const CallModal = () => {
const classes = useStyles(); const classes = useStyles();
const handleAcceptCall = () => { const handleAcceptCall = () => {
console.log("NUI CALL: ", call.phone_number) console.log('NUI CALL: ', call.phone_number);
Nui.send('phone:acceptCall', { Nui.send('phone:acceptCall', {
phoneNumber: call.target, phoneNumber: call.target,
}); });
@@ -26,24 +26,22 @@ export const CallModal = () => {
const handleRejectCall = () => { const handleRejectCall = () => {
setModal(false); setModal(false);
Nui.send('phone:rejectCall', { Nui.send('phone:rejectCall', {
phoneNumber: call.target phoneNumber: call.target,
}) });
}; };
const handleEndCall = () => { const handleEndCall = () => {
setModal(false); setModal(false);
Nui.send('phone:endCall', { Nui.send('phone:endCall', {
phoneNumber: call.target phoneNumber: call.target,
}) });
}; };
if (call.transmitter) { if (call.transmitter) {
return ( return (
<AppWrapper> <AppWrapper>
<AppContent> <AppContent>
<h1 style={{ textAlign: 'center' }}> <h1 style={{ textAlign: 'center' }}>{call.target}</h1>
{call.target}
</h1>
<div className={classes.actions}> <div className={classes.actions}>
<Fab <Fab
onClick={handleEndCall} onClick={handleEndCall}
@@ -53,18 +51,15 @@ export const CallModal = () => {
<CallEndIcon /> <CallEndIcon />
</Fab> </Fab>
</div> </div>
</AppContent> </AppContent>
</AppWrapper> </AppWrapper>
) );
} }
return ( return (
<AppWrapper> <AppWrapper>
<AppContent> <AppContent>
<h1 style={{ textAlign: 'center' }}> <h1 style={{ textAlign: 'center' }}>{call.caller}</h1>
{call.caller}
</h1>
<div className={classes.actions}> <div className={classes.actions}>
{!call.accepted ? ( {!call.accepted ? (
+3 -4
View File
@@ -8,12 +8,11 @@ const useStyles = makeStyles((theme: Theme) => ({
display: 'flex', display: 'flex',
alignContent: 'center', alignContent: 'center',
justifyContent: 'center', justifyContent: 'center',
bottom: '10%' bottom: '10%',
}, },
actionButton: { actionButton: {
margin: 20, margin: 20,
} },
})) }));
export default useStyles; export default useStyles;