mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
feat(callModal/nui): styles and functions for calling modal
Needs to be discussed
This commit is contained in:
1 parent
5ae49f4c7a
commit
a7f3f50f3d
2 files changed
+34
-4
No files matched your search
@@ -17,24 +17,53 @@ export const CallModal = () => {
|
|||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
const handleAcceptCall = () => {
|
const handleAcceptCall = () => {
|
||||||
|
console.log("NUI CALL: ", call.phone_number)
|
||||||
Nui.send('phone:acceptCall', {
|
Nui.send('phone:acceptCall', {
|
||||||
phoneNumber: call.phone_number,
|
phoneNumber: call.target,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRejectCall = () => {
|
const handleRejectCall = () => {
|
||||||
setModal(false);
|
setModal(false);
|
||||||
|
Nui.send('phone:rejectCall', {
|
||||||
|
phoneNumber: call.target
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleEndCall = () => {
|
const handleEndCall = () => {
|
||||||
setModal(false);
|
setModal(false);
|
||||||
|
Nui.send('phone:endCall', {
|
||||||
|
phoneNumber: call.target
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (call.transmitter) {
|
||||||
|
return (
|
||||||
|
<AppWrapper>
|
||||||
|
<AppContent>
|
||||||
|
<h1 style={{ textAlign: 'center' }}>
|
||||||
|
{call.target}
|
||||||
|
</h1>
|
||||||
|
<div className={classes.actions}>
|
||||||
|
<Fab
|
||||||
|
onClick={handleEndCall}
|
||||||
|
style={{ backgroundColor: '#e74c3c', color: '#fff' }}
|
||||||
|
className={classes.actionButton}
|
||||||
|
>
|
||||||
|
<CallEndIcon />
|
||||||
|
</Fab>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</AppContent>
|
||||||
|
</AppWrapper>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppWrapper>
|
<AppWrapper>
|
||||||
<AppContent>
|
<AppContent>
|
||||||
<h1 style={{ textAlign: 'center' }}>
|
<h1 style={{ textAlign: 'center' }}>
|
||||||
{call.transmitter ? call.target : call.caller}
|
{call.caller}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<div className={classes.actions}>
|
<div className={classes.actions}>
|
||||||
|
|||||||
@@ -4,13 +4,14 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||||||
actions: {
|
actions: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
margin: 'auto',
|
margin: 'auto',
|
||||||
|
position: 'absolute',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignContent: 'center',
|
alignContent: 'center',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
marginTop: '5em'
|
bottom: '10%'
|
||||||
},
|
},
|
||||||
actionButton: {
|
actionButton: {
|
||||||
margin: 20
|
margin: 20,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user