Commit 245af567 authored by Muhammadali's avatar Muhammadali

update

parent 54e0e39e
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "4.8.74", "version": "4.8.75",
"description": "", "description": "",
"main": "src/boxDialer.js", "main": "src/boxDialer.js",
"scripts": { "scripts": {
......
/** @format */ /** @format */
import React, { useEffect, useState } from 'react'; import React, {useEffect, useState} from 'react';
import MainBlock, { ModalContainer } from './style'; import MainBlock, {ModalContainer} from './style';
import VerticalAlignTopIcon from '@mui/icons-material/VerticalAlignTop'; import VerticalAlignTopIcon from '@mui/icons-material/VerticalAlignTop';
import CallEndIcon from '@mui/icons-material/CallEnd'; import CallEndIcon from '@mui/icons-material/CallEnd';
import MicIcon from '@mui/icons-material/Mic'; import MicIcon from '@mui/icons-material/Mic';
...@@ -14,7 +14,7 @@ import CallCardDropDown from '../CallCardDropDown'; ...@@ -14,7 +14,7 @@ import CallCardDropDown from '../CallCardDropDown';
import ModalNumpad from '../ModalNumpad'; import ModalNumpad from '../ModalNumpad';
import {useConfigHoldMute} from "../../storage" import {useConfigHoldMute} from "../../storage"
const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => { const Modal = ({children, hidden, hangupButton, phoneNumber, callType}) => {
const boxDialer = window.BoxDialer; const boxDialer = window.BoxDialer;
const configHoldMute = useConfigHoldMute((state) => state) const configHoldMute = useConfigHoldMute((state) => state)
...@@ -44,14 +44,14 @@ const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => { ...@@ -44,14 +44,14 @@ const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => {
if (!modalHidden) return; if (!modalHidden) return;
const selectModalType = (type) => { const selectModalType = (type) => {
console.log('selectModalType_inset_component: ', type)
switch (type) { switch (type) {
case 'incoming': case 'incoming':
return ( return (<ModalContainer.Footer rollUp={rollUp}>
<ModalContainer.Footer rollUp={rollUp}>
<button <button
className='redButton' className='redButton'
onClick={() => boxDialer.skipButtonClick()}> onClick={() => boxDialer.skipButtonClick()}>
<CallEndIcon /> <CallEndIcon/>
ЗАКРЫТЬ ЗАКРЫТЬ
</button> </button>
<button <button
...@@ -59,66 +59,50 @@ const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => { ...@@ -59,66 +59,50 @@ const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => {
onClick={() => boxDialer.answerButtonClick()}> onClick={() => boxDialer.answerButtonClick()}>
ОТВЕТИТЬ ОТВЕТИТЬ
</button> </button>
</ModalContainer.Footer> </ModalContainer.Footer>);
);
case 'outgoing': case 'outgoing':
return ( return (<ModalContainer.Footer rollUp={rollUp}>
<ModalContainer.Footer rollUp={rollUp}>
<button <button
className='greenButton' className='greenButton'
onClick={() => boxDialer.answerButtonClick()}> onClick={() => boxDialer.answerButtonClick()}>
ОТВЕТИТЬ ОТВЕТИТЬ
</button> </button>
</ModalContainer.Footer> </ModalContainer.Footer>);
);
case 'connectingIncoming': case 'connectingIncoming':
return ( return (<ModalContainer.Footer rollUp={rollUp}>
<ModalContainer.Footer rollUp={rollUp}>
<button <button
className='redButton' className='redButton'
onClick={() => boxDialer.skipButtonClick()}> onClick={() => boxDialer.skipButtonClick()}>
<CallEndIcon /> <CallEndIcon/>
ЗАКРЫТЬ ЗАКРЫТЬ
</button> </button>
</ModalContainer.Footer> </ModalContainer.Footer>);
);
case 'connectingOutgoing': case 'connectingOutgoing':
return ( return (<ModalContainer.Footer rollUp={rollUp}>
<ModalContainer.Footer rollUp={rollUp}>
<button <button
className='redButton' className='redButton'
onClick={() => boxDialer.skipButtonClick()}> onClick={() => boxDialer.skipButtonClick()}>
<CallEndIcon /> <CallEndIcon/>
ЗАКРЫТЬ ЗАКРЫТЬ
</button> </button>
</ModalContainer.Footer> </ModalContainer.Footer>);
);
case 'connected': case 'connected':
return ( return (<ModalContainer.Footer justify={'space-between'} rollUp={rollUp}>
<ModalContainer.Footer justify={'space-between'} rollUp={rollUp}>
<div className='outcomingEventStyle'> <div className='outcomingEventStyle'>
<div onClick={() => boxDialer.holdButtonClick()}> <div onClick={() => boxDialer.holdButtonClick()}>
{configHoldMute?.state?.callHold ? ( {configHoldMute?.state?.callHold ? (<PlayArrowIcon style={{color: '#fff'}}/>) : (
<PlayArrowIcon style={{ color: '#fff' }} /> <PauseIcon style={{color: '#fff'}}/>)}
) : (
<PauseIcon style={{ color: '#fff' }} />
)}
</div> </div>
<div onClick={() => boxDialer.muteButtonClick()}> <div onClick={() => boxDialer.muteButtonClick()}>
{configHoldMute?.state?.callMute ? ( {configHoldMute?.state?.callMute ? (<MicOffIcon style={{color: '#fff'}}/>) : (
<MicOffIcon style={{ color: '#fff' }} /> <MicIcon style={{color: '#fff'}}/>)}
) : (
<MicIcon style={{ color: '#fff' }} />
)}
</div> </div>
<div <div
className='transferAreaIcon' className='transferAreaIcon'
onClick={() => { onClick={() => {
window.BX window.BX ? boxDialer.selectUser() : setTransferModel(!transferModel);
? boxDialer.selectUser()
: setTransferModel(!transferModel);
}}> }}>
<SendToMobileIcon style={{ color: '#fff' }} /> <SendToMobileIcon style={{color: '#fff'}}/>
<CallCardDropDown <CallCardDropDown
hiddenState={transferModel} hiddenState={transferModel}
selectUserFunc={selectUserFunc} selectUserFunc={selectUserFunc}
...@@ -126,31 +110,27 @@ const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => { ...@@ -126,31 +110,27 @@ const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => {
</div> </div>
<div className={'openNumpadAreaIcon'}> <div className={'openNumpadAreaIcon'}>
<DialpadIcon <DialpadIcon
style={{ color: '#fff' }} style={{color: '#fff'}}
onClick={() => openNumpad()} onClick={() => openNumpad()}
/> />
<ModalNumpad hidden={numpadModal} /> <ModalNumpad hidden={numpadModal}/>
</div> </div>
</div> </div>
<button <button
className='redButton' className='redButton'
onClick={() => boxDialer.skipButtonClick()}> onClick={() => boxDialer.skipButtonClick()}>
<CallEndIcon /> <CallEndIcon/>
ЗАКРЫТЬ ЗАКРЫТЬ
</button> </button>
</ModalContainer.Footer> </ModalContainer.Footer>);
);
default: default:
return ( return (<ModalContainer.Footer rollUp={rollUp}>
<ModalContainer.Footer rollUp={rollUp}>
Do not fount event Do not fount event
</ModalContainer.Footer> </ModalContainer.Footer>);
);
} }
}; };
return ( return (<MainBlock
<MainBlock
hidden={modalHidden || modalHidden} hidden={modalHidden || modalHidden}
rollUp={rollUp} rollUp={rollUp}
onClick={(e) => e.stopPropagation()}> onClick={(e) => e.stopPropagation()}>
...@@ -165,7 +145,7 @@ const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => { ...@@ -165,7 +145,7 @@ const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => {
Свернуть Свернуть
</p> </p>
</ModalContainer.Top> </ModalContainer.Top>
<hr /> <hr/>
<ModalContainer.Head rollUp={rollUp}> <ModalContainer.Head rollUp={rollUp}>
<div className='round'></div> <div className='round'></div>
<p className='name'>No name</p> <p className='name'>No name</p>
...@@ -183,11 +163,10 @@ const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => { ...@@ -183,11 +163,10 @@ const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => {
ЗАКРЫТЬ ЗАКРЫТЬ
</button> </button>
<button className='rollUpUn' onClick={() => setRollUp(false)}> <button className='rollUpUn' onClick={() => setRollUp(false)}>
<VerticalAlignTopIcon /> <VerticalAlignTopIcon/>
</button> </button>
</div> </div>
</MainBlock> </MainBlock>);
);
}; };
export default Modal; export default Modal;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment