Commit 851b9fe7 authored by Muhammadali's avatar Muhammadali

1.5.8

parent 0ff5beac
{
"name": "boxdialer",
"version": "1.5.7",
"version": "1.5.8",
"description": "",
"main": "src/boxDialer.js",
"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 {
break;
case 'stack_i_new_call':
if (!!!this.oSipSessionCall.o_session.o_stream_remote.id) {
this.onSipStateChange.secondLine(false);
}
if (this.oSipSessionCall.o_session.o_stream_remote.id) {
console.log('oSipSessionCall__', 'SECOND_line');
this.onSipStateChange.secondLine(true);
......
......@@ -6,6 +6,7 @@ import DefaultWidjetUi from '../components/DefaultWidjetUi';
import ModalPhoneNumpad from '../components/ModalPhoneNumpad';
import Modal from '../components/Modal';
import BxMiniWidjetUi from '../components/BxMiniWidjetUi';
import SecondNotifSip from '../components/SecondNotifSip';
const Root = ({ data, onSetDnd }) => {
let localValue = localStorage.getItem('activeValue') || false;
......@@ -36,7 +37,15 @@ const Root = ({ data, onSetDnd }) => {
const [secondLine, setSecondLine] = useState(false);
const boxDialer = window.BoxDialer;
console.log(secondLine, 'secondLine');
useEffect(() => {
if (secondLine) {
setTimeout(() => {
setSecondLine(false);
}, 3000);
}
}, [secondLine]);
useEffect(() => {
if (data && data?.number) {
boxDialer.setSipStateChangeCallback(setDynamicValue, 'dynamicValue');
......@@ -130,6 +139,8 @@ const Root = ({ data, onSetDnd }) => {
: 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