Commit 851b9fe7 authored by Muhammadali's avatar Muhammadali

1.5.8

parent 0ff5beac
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "1.5.7", "version": "1.5.8",
"description": "", "description": "",
"main": "src/boxDialer.js", "main": "src/boxDialer.js",
"scripts": { "scripts": {
......
/** @format */
import React from 'react';
import styled from 'styled-components';
const Block = styled.div`
border: 1px solid red;
width: 300px;
height: 60px;
background-color: #c9d5d9;
border-radius: 10px;
padding: 10px;
position: fixed;
transition: 1s;
top: 20px;
right: -340px;
animation: ${({ secondLine }) => (secondLine ? 'anim 5s' : '')};
@keyframes anim {
0% {
right: -340px;
}
5% {
right: 20px;
}
95% {
right: 20px;
}
100% {
right: -340px;
}
}
`;
const SecondNotifSip = ({ secondLine }) => {
console.log(secondLine, 'secondLine');
return <Block secondLine={secondLine}></Block>;
};
export default SecondNotifSip;
...@@ -345,9 +345,7 @@ export class BoxDialer { ...@@ -345,9 +345,7 @@ export class BoxDialer {
break; break;
case 'stack_i_new_call': case 'stack_i_new_call':
if (!!!this.oSipSessionCall.o_session.o_stream_remote.id) { this.onSipStateChange.secondLine(false);
this.onSipStateChange.secondLine(false);
}
if (this.oSipSessionCall.o_session.o_stream_remote.id) { if (this.oSipSessionCall.o_session.o_stream_remote.id) {
console.log('oSipSessionCall__', 'SECOND_line'); console.log('oSipSessionCall__', 'SECOND_line');
this.onSipStateChange.secondLine(true); this.onSipStateChange.secondLine(true);
......
...@@ -6,6 +6,7 @@ import DefaultWidjetUi from '../components/DefaultWidjetUi'; ...@@ -6,6 +6,7 @@ import DefaultWidjetUi from '../components/DefaultWidjetUi';
import ModalPhoneNumpad from '../components/ModalPhoneNumpad'; import ModalPhoneNumpad from '../components/ModalPhoneNumpad';
import Modal from '../components/Modal'; import Modal from '../components/Modal';
import BxMiniWidjetUi from '../components/BxMiniWidjetUi'; import BxMiniWidjetUi from '../components/BxMiniWidjetUi';
import SecondNotifSip from '../components/SecondNotifSip';
const Root = ({ data, onSetDnd }) => { const Root = ({ data, onSetDnd }) => {
let localValue = localStorage.getItem('activeValue') || false; let localValue = localStorage.getItem('activeValue') || false;
...@@ -36,7 +37,15 @@ const Root = ({ data, onSetDnd }) => { ...@@ -36,7 +37,15 @@ const Root = ({ data, onSetDnd }) => {
const [secondLine, setSecondLine] = useState(false); const [secondLine, setSecondLine] = useState(false);
const boxDialer = window.BoxDialer; const boxDialer = window.BoxDialer;
console.log(secondLine, 'secondLine');
useEffect(() => {
if (secondLine) {
setTimeout(() => {
setSecondLine(false);
}, 3000);
}
}, [secondLine]);
useEffect(() => { useEffect(() => {
if (data && data?.number) { if (data && data?.number) {
boxDialer.setSipStateChangeCallback(setDynamicValue, 'dynamicValue'); boxDialer.setSipStateChangeCallback(setDynamicValue, 'dynamicValue');
...@@ -130,6 +139,8 @@ const Root = ({ data, onSetDnd }) => { ...@@ -130,6 +139,8 @@ const Root = ({ data, onSetDnd }) => {
: modalState.callFromName : modalState.callFromName
} }
/> />
<SecondNotifSip secondLine={secondLine} />
</> </>
); );
}; };
......
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