Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
BoxDialer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
BoxDialer
Commits
8f82117d
Commit
8f82117d
authored
Aug 28, 2023
by
Muhammadali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update verison: 0.8.3
parent
360f0efa
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
495 additions
and
254 deletions
+495
-254
package.json
package.json
+1
-1
index.jsx
src/components/BxMiniWidjetUi/index.jsx
+37
-0
style.js
src/components/BxMiniWidjetUi/style.js
+93
-0
index.jsx
src/components/DefaultWidjetUi/index.jsx
+7
-3
style.js
src/components/DefaultWidjetUi/style.js
+2
-3
index.jsx
src/components/ModalPhoneNumpad/index.jsx
+175
-164
style.js
src/components/ModalPhoneNumpad/style.js
+79
-70
boxDialerWidjetPosition.js
src/lib/boxDialerWidjetPosition.js
+54
-0
index.jsx
src/root/index.jsx
+47
-13
No files found.
package.json
View file @
8f82117d
{
{
"name"
:
"boxdialer"
,
"name"
:
"boxdialer"
,
"version"
:
"0.8.
2
"
,
"version"
:
"0.8.
3
"
,
"description"
:
""
,
"description"
:
""
,
"main"
:
"src/boxDialer.js"
,
"main"
:
"src/boxDialer.js"
,
"scripts"
:
{
"scripts"
:
{
...
...
src/components/BxMiniWidjetUi/index.jsx
0 → 100644
View file @
8f82117d
/** @format */
import
React
from
'
react
'
;
import
BxMiniWidjetUiStyle
,
{
DialPadIcon
}
from
'
./style
'
;
import
TimerUi
from
'
../TimerUi
'
;
const
BxMiniWidjetUi
=
({
widjetState
,
phoneNumber
,
reason
,
widjetVersion
,
leftTime
,
onClick
,
position
,
})
=>
{
return
(
<
BxMiniWidjetUiStyle
status=
{
widjetState
}
onClick=
{
onClick
}
position=
{
position
}
>
<
div
className=
'left'
>
<
p
className=
'title'
>
{
phoneNumber
}
</
p
>
<
p
>
<
span
className=
'status'
>
{
widjetState
}
</
span
>
<
TimerUi
reason=
{
reason
}
time=
{
leftTime
}
/>
</
p
>
</
div
>
<
div
className=
'bottom'
>
<
BxMiniWidjetUiStyle
.
StatusLine
status=
{
widjetState
}
>
<
p
className=
'verison'
>
v
{
widjetVersion
}
</
p
>
</
BxMiniWidjetUiStyle
.
StatusLine
>
</
div
>
</
BxMiniWidjetUiStyle
>
);
};
export
default
BxMiniWidjetUi
;
src/components/BxMiniWidjetUi/style.js
0 → 100644
View file @
8f82117d
/** @format */
import
styled
from
'
styled-components
'
;
import
CallIcon
from
'
@mui/icons-material/Dialpad
'
;
import
{
boxDialerWidjetPosition
}
from
'
../../lib/boxDialerWidjetPosition
'
;
const
BxMiniWidjetUiStyle
=
styled
.
div
`
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
height: 70px;
width: 80px;
border-radius: 13px;
background-color: #164e63e6;
cursor: pointer;
color: white;
z-index: 999;
position: fixed;
display: grid;
align-items: center;
grid-template-columns: 1fr;
grid-template-rows: 1fr 10px;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
${({
position
})
=>
boxDialerWidjetPosition
[
position
].
block
}
.left {
display: flex;
flex-direction: column;
align-items: center;
}
.right {
}
.title {
font-size: 20px;
font-weight: 600;
}
.bottom {
height: 100%;
grid-column: 1/3;
grid-row: 2/3;
}
.status {
border-radius: 10px;
padding: 0 3px;
margin: 0 5px;
font-size: 12px;
background-color:
${({
status
})
=>
status
===
'
pending
'
?
'
orange
'
:
status
===
'
connected
'
?
'
#a0c13d
'
:
'
#ccc
'
}
;
color:
${({
status
})
=>
status
===
'
pending
'
?
'
#fff
'
:
status
===
'
connected
'
?
'
#333
'
:
'
#ccc
'
}
;
}
`
;
BxMiniWidjetUiStyle
.
StatusLine
=
styled
.
div
`
height: 100%;
background-color:
${({
backColor
})
=>
backColor
}
;
border-bottom-left-radius: 30px;
border-bottom-right-radius: 30px;
background-color:
${({
status
})
=>
status
===
'
pending
'
?
'
orange
'
:
status
===
'
connected
'
?
'
#a0c13d
'
:
'
#ccc
'
}
;
display: flex;
align-items: center;
justify-content: flex-end;
padding: 0 10px 0 0;
color: green;
.verison {
font-size: 10px;
font-weight: bold;
float: right;
}
`
;
const
DialPadIcon
=
styled
(
CallIcon
)
`
font-size: 26px;
`
;
export
{
DialPadIcon
};
export
default
BxMiniWidjetUiStyle
;
src/components/DefaultWidjetUi/index.jsx
View file @
8f82117d
...
@@ -4,16 +4,20 @@ import React from 'react';
...
@@ -4,16 +4,20 @@ import React from 'react';
import
DefaultWidjetStyle
,
{
DialPadIcon
}
from
'
./style
'
;
import
DefaultWidjetStyle
,
{
DialPadIcon
}
from
'
./style
'
;
import
TimerUi
from
'
../TimerUi
'
;
import
TimerUi
from
'
../TimerUi
'
;
const
DefaultWidjet
=
({
const
DefaultWidjet
Ui
=
({
widjetState
,
widjetState
,
phoneNumber
,
phoneNumber
,
reason
,
reason
,
widjetVersion
,
widjetVersion
,
leftTime
,
leftTime
,
onClick
,
onClick
,
position
,
})
=>
{
})
=>
{
return
(
return
(
<
DefaultWidjetStyle
status=
{
widjetState
}
onClick=
{
onClick
}
>
<
DefaultWidjetStyle
status=
{
widjetState
}
onClick=
{
onClick
}
position=
{
position
}
>
<
div
className=
'left'
>
<
div
className=
'left'
>
<
p
className=
'title'
>
{
phoneNumber
}
</
p
>
<
p
className=
'title'
>
{
phoneNumber
}
</
p
>
<
p
>
<
p
>
...
@@ -33,4 +37,4 @@ const DefaultWidjet = ({
...
@@ -33,4 +37,4 @@ const DefaultWidjet = ({
);
);
};
};
export
default
DefaultWidjet
;
export
default
DefaultWidjet
Ui
;
src/components/DefaultWidjetUi/style.js
View file @
8f82117d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
styled
from
'
styled-components
'
;
import
styled
from
'
styled-components
'
;
import
CallIcon
from
'
@mui/icons-material/Dialpad
'
;
import
CallIcon
from
'
@mui/icons-material/Dialpad
'
;
import
{
boxDialerWidjetPosition
}
from
'
../../lib/boxDialerWidjetPosition
'
;
const
DefaultWidjetStyle
=
styled
.
div
`
const
DefaultWidjetStyle
=
styled
.
div
`
* {
* {
...
@@ -20,9 +21,7 @@ const DefaultWidjetStyle = styled.div`
...
@@ -20,9 +21,7 @@ const DefaultWidjetStyle = styled.div`
z-index: 999;
z-index: 999;
position: fixed;
position: fixed;
bottom: 30px;
${({
position
})
=>
boxDialerWidjetPosition
[
position
].
block
}
left: 50px;
display: grid;
display: grid;
align-items: center;
align-items: center;
grid-template-columns: 1fr 30px;
grid-template-columns: 1fr 30px;
...
...
src/components/ModalPhoneNumpad/index.jsx
View file @
8f82117d
This diff is collapsed.
Click to expand it.
src/components/ModalPhoneNumpad/style.js
View file @
8f82117d
import
styled
from
'
styled-components
'
/** @format */
import
KeyboardBackspaceIcon
from
"
@mui/icons-material/KeyboardBackspace
"
import
styled
from
'
styled-components
'
;
import
KeyboardBackspaceIcon
from
'
@mui/icons-material/KeyboardBackspace
'
;
import
{
boxDialerWidjetPosition
}
from
'
../../lib/boxDialerWidjetPosition
'
;
const
ModalPhoneNumpadStyle
=
styled
.
div
`
const
ModalPhoneNumpadStyle
=
styled
.
div
`
width: 230px;
width: 230px;
position: fixed;
position: fixed;
bottom: 120px;
bottom: 120px;
transition: 0.2s;
transition: 0.2s;
z-index: 999;
z-index: 999;
transform: translate(
${({
hidden
})
=>
(
hidden
?
'
-300px
'
:
'
325px
'
)}
, 0%);
${({
hidden
,
position
})
=>
left: -300px;
hidden
background-color: #c9d5d9;
?
boxDialerWidjetPosition
[
position
].
numpad
.
hidden
border-radius: 20px;
:
boxDialerWidjetPosition
[
position
].
numpad
.
seen
}
padding: 15px;
display: grid;
background-color: #c9d5d9;
grid-template-rows: 40px 1fr;
border-radius: 20px;
grid-gap: 15px;
padding: 15px;
cursor: default;
display: grid;
grid-template-rows: 40px 1fr;
grid-gap: 15px;
cursor: default;
`
;
`
;
ModalPhoneNumpadStyle
.
InputArea
=
styled
.
div
`
ModalPhoneNumpadStyle
.
InputArea
=
styled
.
div
`
position: relative;
position: relative;
`
;
`
;
ModalPhoneNumpadStyle
.
ButtonArea
=
styled
.
div
`
ModalPhoneNumpadStyle
.
ButtonArea
=
styled
.
div
`
display: grid;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-columns: 1fr 1fr 1fr;
grid-gap: 8px;
grid-gap: 8px;
`
;
`
;
const
Input
=
styled
.
input
`
const
Input
=
styled
.
input
`
width: 100%;
width: 100%;
height: 100%;
height: 100%;
border-radius: 3px;
border-radius: 3px;
background-color: #fff;
background-color: #fff;
border: 0;
border: 0;
padding: 0 35px 0 10px;
padding: 0 35px 0 10px;
font-size: 22px;
font-size: 22px;
color: #000;
color: #000;
:focus {
:focus {
border-color: inherit;
border-color: inherit;
-webkit-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
box-shadow: none;
padding: 0 10px;
padding: 0 10px;
font-size: 24px;
font-size: 24px;
outline: 0 none;
outline: 0 none;
}
}
position: relative;
position: relative;
display: inline-block;
display: inline-block;
margin: 0;
margin: 0;
outline: none;
outline: none;
&::-webkit-outer-spin-button,
&::-webkit-outer-spin-button,
&::-webkit-inner-spin-button {
&::-webkit-inner-spin-button {
-webkit-appearance: none;
-webkit-appearance: none;
margin: 0;
margin: 0;
}
}
/* Firefox */
/* Firefox */
&[type='number'] {
&[type='number'] {
-moz-appearance: textfield;
-moz-appearance: textfield;
}
}
`
;
`
;
Input
.
BackSpaceIcon
=
styled
(
KeyboardBackspaceIcon
)
`
Input
.
BackSpaceIcon
=
styled
(
KeyboardBackspaceIcon
)
`
color: black;
color: black;
position: absolute;
position: absolute;
right: 5px;
right: 5px;
cursor: pointer;
cursor: pointer;
top: 50%;
top: 50%;
transform: translate(0, -50%);
transform: translate(0, -50%);
`
;
`
;
const
NumberButton
=
styled
.
div
`
const
NumberButton
=
styled
.
div
`
color: #fff;
color: #fff;
font-weight: bold;
font-weight: bold;
display: flex;
display: flex;
justify-content: center;
justify-content: center;
align-items: center;
align-items: center;
border-radius: 7px;
border-radius: 7px;
font-size: 22px;
font-size: 22px;
cursor: pointer;
cursor: pointer;
height: 33px;
height: 33px;
background-color:
${({
background-color:
${({
status
,
type
})
=>
status
,
type
type
===
'
call_button
'
})
=>
type
===
'
call_button
'
?
status
===
'
pending
'
?
'
orange
'
:
status
===
'
connected
'
&&
'
#a0c13d
'
:
'
#5e5e5e
'
}
;
?
status
===
'
pending
'
?
'
orange
'
:
status
===
'
connected
'
&&
'
#a0c13d
'
:
'
#5e5e5e
'
}
;
`
;
`
;
NumberButton
.
Icon
=
styled
.
div
`
NumberButton
.
Icon
=
styled
.
div
`
font-size: 20px;
font-size: 20px;
`
;
`
;
export
{
NumberButton
,
Input
}
export
{
NumberButton
,
Input
};
export
default
ModalPhoneNumpadStyle
export
default
ModalPhoneNumpadStyle
;
src/lib/boxDialerWidjetPosition.js
0 → 100644
View file @
8f82117d
/** @format */
export
const
boxDialerWidjetPosition
=
{
bottomLeft
:
{
block
:
{
bottom
:
'
30px
'
,
left
:
'
50px
'
,
},
numpad
:
{
hidden
:
{
left
:
'
-300px
'
,
},
seen
:
{
left
:
'
25px
'
,
},
},
},
bottomCenter
:
{
block
:
{
transform
:
'
translate(-50%, 0)
'
,
bottom
:
'
30px
'
,
left
:
'
50%
'
,
},
numpad
:
{
hidden
:
{
bottom
:
'
-300px
'
,
left
:
'
50%
'
,
transform
:
'
translate(-50%, 0)
'
,
},
seen
:
{
bottom
:
'
120px
'
,
left
:
'
50%
'
,
transform
:
'
translate(-50%, 0)
'
,
},
},
},
bottomRight
:
{
block
:
{
bottom
:
'
30px
'
,
left
:
'
auto
'
,
right
:
'
50px
'
,
},
numpad
:
{
hidden
:
{
left
:
'
auto
'
,
right
:
'
-300px
'
,
},
seen
:
{
left
:
'
auto
'
,
right
:
'
25px
'
,
},
},
},
};
src/root/index.jsx
View file @
8f82117d
...
@@ -3,11 +3,12 @@
...
@@ -3,11 +3,12 @@
import
WidjetButton
from
'
../components/WidjetButton
'
;
import
WidjetButton
from
'
../components/WidjetButton
'
;
import
React
,
{
useEffect
,
useState
}
from
'
react
'
;
import
React
,
{
useEffect
,
useState
}
from
'
react
'
;
import
packageJson
from
'
../../package.json
'
;
import
packageJson
from
'
../../package.json
'
;
import
DefaultWidjet
from
'
../components/DefaultWidjetUi
'
;
import
DefaultWidjet
Ui
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
'
;
const
Root
=
({
data
,
onSetDnd
,
position
})
=>
{
const
Root
=
({
data
,
onSetDnd
})
=>
{
if
(
!
data
)
{
if
(
!
data
)
{
data
=
{
data
=
{
iscloud
:
true
,
iscloud
:
true
,
...
@@ -19,6 +20,7 @@ const Root = ({ data, onSetDnd, position }) => {
...
@@ -19,6 +20,7 @@ const Root = ({ data, onSetDnd, position }) => {
lefttime
:
231461
,
lefttime
:
231461
,
reasons
:
[
'
free
'
,
'
outcalls
'
,
'
home
'
,
'
totop
'
],
reasons
:
[
'
free
'
,
'
outcalls
'
,
'
home
'
,
'
totop
'
],
variant
:
'
bxmini
'
,
variant
:
'
bxmini
'
,
position
:
'
bottomRight
'
,
};
};
}
}
...
@@ -45,20 +47,50 @@ const Root = ({ data, onSetDnd, position }) => {
...
@@ -45,20 +47,50 @@ const Root = ({ data, onSetDnd, position }) => {
boxDialer
.
hangupButtonClick
();
boxDialer
.
hangupButtonClick
();
};
};
if
(
!
data
||
!
data
?.
number
)
return
;
const
selectWidjetType
=
(
type
)
=>
{
switch
(
type
)
{
case
'
bxmini
'
:
return
(
<
BxMiniWidjetUi
widjetState=
{
dynamicValue
}
phoneNumber=
{
data
?.
number
}
reason=
{
data
?.
reason
}
widjetVersion=
{
packageJson
?.
version
}
leftTime=
{
data
.
lefttime
}
position=
{
data
.
position
||
'
bottomLeft
'
}
onClick=
{
()
=>
{
phoneModal
?
setPhoneModal
(
false
)
:
setPhoneModal
(
true
);
}
}
/>
);
default
:
return
(
<
DefaultWidjetUi
widjetState=
{
dynamicValue
}
phoneNumber=
{
data
?.
number
}
reason=
{
data
?.
reason
}
widjetVersion=
{
packageJson
?.
version
}
leftTime=
{
data
.
lefttime
}
position=
{
data
.
position
||
'
bottomLeft
'
}
onClick=
{
()
=>
{
phoneModal
?
setPhoneModal
(
false
)
:
setPhoneModal
(
true
);
}
}
/>
);
}
};
if
(
!
data
||
!
data
?.
number
// || !data?.position
)
return
;
return
(
return
(
<>
<>
<
DefaultWidjet
{
selectWidjetType
(
data
.
variant
)
}
widjetState=
{
dynamicValue
}
phoneNumber=
{
data
?.
number
}
reason=
{
data
?.
reason
}
widjetVersion=
{
packageJson
?.
version
}
leftTime=
{
data
.
lefttime
}
onClick=
{
()
=>
{
phoneModal
?
setPhoneModal
(
false
)
:
setPhoneModal
(
true
);
}
}
/>
<
ModalPhoneNumpad
<
ModalPhoneNumpad
modalState=
{
modalState
}
modalState=
{
modalState
}
phoneModal=
{
phoneModal
}
phoneModal=
{
phoneModal
}
...
@@ -67,7 +99,9 @@ const Root = ({ data, onSetDnd, position }) => {
...
@@ -67,7 +99,9 @@ const Root = ({ data, onSetDnd, position }) => {
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
dynamicValue=
{
dynamicValue
}
dynamicValue=
{
dynamicValue
}
onSetDnd=
{
onSetDnd
}
onSetDnd=
{
onSetDnd
}
position=
{
data
.
position
||
'
bottomLeft
'
}
/>
/>
<
Modal
<
Modal
className=
'tailwindGlobalCss'
className=
'tailwindGlobalCss'
callAnswerType=
{
modalState
.
callType
}
callAnswerType=
{
modalState
.
callType
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment