diff --git a/phone/src/modal/components/CallModal.tsx b/phone/src/modal/components/CallModal.tsx index b3392ec..a1af711 100644 --- a/phone/src/modal/components/CallModal.tsx +++ b/phone/src/modal/components/CallModal.tsx @@ -31,7 +31,7 @@ export const CallModal = () => { }; const handleEndCall = () => { - setModal(false) + setModal(false); Nui.send('phone:endCall', { transmitterNumber: call.transmitter, }); @@ -41,9 +41,8 @@ export const CallModal = () => { return ( -

{call.receiver}

- +
{

{call.transmitter}

- +
{!call.accepted ? ( <> diff --git a/phone/src/modal/components/CallTimer.tsx b/phone/src/modal/components/CallTimer.tsx index 38c8cdf..8e61160 100644 --- a/phone/src/modal/components/CallTimer.tsx +++ b/phone/src/modal/components/CallTimer.tsx @@ -1,49 +1,54 @@ -import React, { useState, useCallback, useEffect } from 'react' +import React, { useState, useCallback, useEffect } from 'react'; function CallTimer({ isAccepted }) { - const [time, setTime] = useState({ ms: 0, s: 0, m: 0, h: 0 }) + const [time, setTime] = useState({ ms: 0, s: 0, m: 0, h: 0 }); useEffect(() => { - let timer = null + let timer = null; if (isAccepted) { - run() - timer = setInterval(run, 10) + run(); + timer = setInterval(run, 10); } - return () => clearInterval(timer) + return () => clearInterval(timer); }, []); - let updatedMs = time.ms, updatedS = time.s, updatedM = time.m, updatedH = time.h; - + let updatedMs = time.ms, + updatedS = time.s, + updatedM = time.m, + updatedH = time.h; + const run = () => { if (updatedM === 60) { updatedH++; updatedM = 0; - } + } if (updatedS === 60) { updatedM++; updatedS = 0; - } + } if (updatedMs === 100) { updatedS++; - updatedMs = 0 + updatedMs = 0; } updatedMs++; - return setTime({ ms: updatedMs, s: updatedS, m: updatedM, h: updatedH }) - } + return setTime({ ms: updatedMs, s: updatedS, m: updatedM, h: updatedH }); + }; if (!isAccepted) return null; return ( -
- {(time.h >= 10) ? time.h : '0'+time.h} :  - {(time.m >= 10) ? time.m : '0'+time.m} :  - {(time.s >= 10) ? time.s : '0'+time.s}  +
+ {time.h >= 10 ? time.h : '0' + time.h} :  + {time.m >= 10 ? time.m : '0' + time.m} :  + {time.s >= 10 ? time.s : '0' + time.s} 
- ) + ); } -export default CallTimer +export default CallTimer;