Commit e9306056 authored by Muhammadali's avatar Muhammadali

update

parent 538fd835
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "1.6.1", "version": "1.6.2",
"description": "", "description": "",
"main": "src/boxDialer.js", "main": "src/boxDialer.js",
"scripts": { "scripts": {
......
...@@ -13,9 +13,34 @@ const BxMiniWidjetUi = ({ ...@@ -13,9 +13,34 @@ const BxMiniWidjetUi = ({
onClick, onClick,
position, position,
}) => { }) => {
const colorTypeFunc = ({ widjetState, reason }) => {
console.log('color_type', `${widjetState}_${reason}`);
switch (`${widjetState}_${reason}`) {
case 'pending':
return {
backgroundColor: 'gray',
color: '#fff',
};
break;
case 'connected':
return '#a0c13d';
break;
case 'connected':
return '#a0c13d';
break;
default:
return {
backgroundColor: 'gray',
color: '#fff',
};
break;
}
};
return ( return (
<BxMiniWidjetUiStyle <BxMiniWidjetUiStyle
status={widjetState || ''} // status={widjetState || ''}
status={colorTypeFunc({ reason, widjetState })}
onClick={onClick} onClick={onClick}
position={position}> position={position}>
<div className='left'> <div className='left'>
...@@ -31,7 +56,8 @@ const BxMiniWidjetUi = ({ ...@@ -31,7 +56,8 @@ const BxMiniWidjetUi = ({
</div> </div>
</div> </div>
<div className='bottom'> <div className='bottom'>
<BxMiniWidjetUiStyle.StatusLine status={widjetState || ''}> <BxMiniWidjetUiStyle.StatusLine
status={colorTypeFunc({ reason, widjetState }) || ''}>
<p className='verison'> <p className='verison'>
v <span>{widjetVersion}</span> v <span>{widjetVersion}</span>
</p> </p>
......
...@@ -4,14 +4,30 @@ import styled from 'styled-components'; ...@@ -4,14 +4,30 @@ import styled from 'styled-components';
import CallIcon from '@mui/icons-material/Dialpad'; import CallIcon from '@mui/icons-material/Dialpad';
import { boxDialerWidjetPosition } from '../../lib/boxDialerWidjetPosition'; import { boxDialerWidjetPosition } from '../../lib/boxDialerWidjetPosition';
const colorTypeFunc = (type) => {
switch (type) {
case 'pending':
return 'orange';
break;
case 'connected':
return '#a0c13d';
break;
default:
break;
}
};
const BxMiniWidjetUiStyle = styled.div` const BxMiniWidjetUiStyle = styled.div`
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
background-color: ${({ status = '' }) => /* background-color: ${({ status = '' }) =>
status === 'pending' status === 'pending'
? 'orange' ? 'orange'
: status === 'connected' : status === 'connected'
? '#a0c13d' ? '#a0c13d'
: '#ccc'}; : '#ccc'}; */
/* background-color: ${({ status = '' }) => (status ? status : '#333')}; */
${({ status }) => (status ? status : {})}
height: 64px; height: 64px;
width: 64px; width: 64px;
border-radius: 13px; border-radius: 13px;
...@@ -82,17 +98,17 @@ BxMiniWidjetUiStyle.StatusLine = styled.div` ...@@ -82,17 +98,17 @@ BxMiniWidjetUiStyle.StatusLine = styled.div`
height: 100%; height: 100%;
border-bottom-left-radius: 30px; border-bottom-left-radius: 30px;
border-bottom-right-radius: 30px; border-bottom-right-radius: 30px;
background-color: ${({ status = '' }) => /* background-color: ${({ status = '' }) =>
status === 'pending' status === 'pending'
? 'orange' ? 'orange'
: status === 'connected' : status === 'connected'
? '#a0c13d' ? '#a0c13d'
: '#ccc'}; : '#ccc'}; */
${({ status }) => (status ? status : {})}
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
padding: 0 10px 0 0; padding: 0 10px 0 0;
color: green;
.verison { .verison {
font-size: 10px; font-size: 10px;
font-weight: bold; font-weight: bold;
......
...@@ -260,6 +260,7 @@ export class BoxDialer { ...@@ -260,6 +260,7 @@ export class BoxDialer {
this.onSipStateChange[funcName](funcParam); this.onSipStateChange[funcName](funcParam);
} }
} }
bxLog(...datas) { bxLog(...datas) {
console.log(`%c BXLOG:`, datas, 'background-color: red;'); console.log(`%c BXLOG:`, datas, 'background-color: red;');
} }
......
...@@ -69,13 +69,6 @@ const Root = ({ data, onSetDnd }) => { ...@@ -69,13 +69,6 @@ const Root = ({ data, onSetDnd }) => {
data = result; data = result;
}; };
// console.log(phoneModal, modalState, 'phoneModal');
// console.log(
// boxDialer.oSipSessionCall.o_session.o_stream_remote.id,
// 'oSipSessionCall',
// );
const selectWidjetType = (type) => { const selectWidjetType = (type) => {
switch (type) { switch (type) {
case 'bxmini': case 'bxmini':
......
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