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
80c1e21d
Commit
80c1e21d
authored
Oct 20, 2023
by
Muhammadali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update-
parent
c8b6c416
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
21 deletions
+59
-21
package.json
package.json
+1
-1
index.jsx
src/components/InnerCaller/index.jsx
+6
-8
index.jsx
src/components/Modal/index.jsx
+9
-6
index.jsx
src/components/ModalPhoneNumpad/index.jsx
+1
-2
index.jsx
src/context/index.jsx
+14
-0
modalEventProperty.js
src/context/modalEventProperty.js
+21
-0
index.js
src/index.js
+7
-4
No files found.
package.json
View file @
80c1e21d
{
"name"
:
"boxdialer"
,
"version"
:
"4.8.1
4
"
,
"version"
:
"4.8.1
5
"
,
"description"
:
""
,
"main"
:
"src/boxDialer.js"
,
"scripts"
:
{
...
...
src/components/InnerCaller/index.jsx
View file @
80c1e21d
...
...
@@ -11,15 +11,13 @@ import MicIcon from '@mui/icons-material/Mic';
import
MicOffIcon
from
'
@mui/icons-material/MicOff
'
;
import
PlayArrowIcon
from
'
@mui/icons-material/PlayArrow
'
;
import
PauseIcon
from
'
@mui/icons-material/Pause
'
;
import
{
contextModalEventProperty
}
from
'
../../context/modalEventProperty
'
;
import
{
useContext
}
from
'
react
'
;
const
InnerCaller
=
({
hidden
,
type
,
from
,
innerTimer
})
=>
{
const
boxDialer
=
window
.
BoxDialer
;
const
translator
=
useTranslator
();
const
[
callEvents
,
setCallEvents
]
=
useState
({});
useEffect
(()
=>
{
boxDialer
.
setSipStateChangeCallback
(
setCallEvents
,
'
setCallEvents
'
);
},
[]);
const
[
callEvents
,
setCallEvents
]
=
useContext
(
contextModalEventProperty
);
const
dataFormatter
=
(
secund
)
=>
{
let
ts
=
intervalToDuration
({
start
:
0
,
...
...
@@ -29,7 +27,7 @@ const InnerCaller = ({ hidden, type, from, innerTimer }) => {
?
`
${
ts
.
hours
}
:
${
ts
.
minutes
}
:
${
ts
.
seconds
}
`
:
`
${
ts
.
minutes
}
:
${
ts
.
seconds
}
`
;
};
console
.
log
(
'
callEvents_callHold:
'
,
callEvents
.
callHold
);
console
.
log
(
'
callEvents_callHold:
'
,
callEvents
?
.
callHold
);
const
selectModalType
=
(
type
)
=>
{
switch
(
type
)
{
...
...
@@ -39,14 +37,14 @@ const InnerCaller = ({ hidden, type, from, innerTimer }) => {
<
div
className=
'button timer'
>
<
div
>
{
dataFormatter
(
innerTimer
)
}
</
div
>
<
div
onClick=
{
()
=>
boxDialer
.
holdButtonClick
()
}
>
{
callEvents
.
callHold
?
(
{
callEvents
?
.
callHold
?
(
<
PlayArrowIcon
style=
{
{
color
:
'
#fff
'
}
}
/>
)
:
(
<
PauseIcon
style=
{
{
color
:
'
#fff
'
}
}
/>
)
}
</
div
>
<
div
onClick=
{
()
=>
boxDialer
.
muteButtonClick
()
}
>
{
callEvents
.
callMute
?
(
{
callEvents
?
.
callMute
?
(
<
MicOffIcon
style=
{
{
color
:
'
#fff
'
}
}
/>
)
:
(
<
MicIcon
style=
{
{
color
:
'
#fff
'
}
}
/>
...
...
src/components/Modal/index.jsx
View file @
80c1e21d
...
...
@@ -12,18 +12,21 @@ import SendToMobileIcon from '@mui/icons-material/SendToMobile';
import
DialpadIcon
from
'
@mui/icons-material/Dialpad
'
;
import
CallCardDropDown
from
'
../CallCardDropDown
'
;
import
ModalNumpad
from
'
../ModalNumpad
'
;
import
{
useContext
}
from
'
react
'
;
import
{
contextModalEventProperty
}
from
'
../../context/modalEventProperty
'
;
const
Modal
=
({
children
,
hidden
,
hangupButton
,
phoneNumber
,
callType
})
=>
{
const
boxDialer
=
window
.
BoxDialer
;
const
[
rollUp
,
setRollUp
]
=
useState
(
false
);
const
[
modalHidden
,
setModalHidden
]
=
useState
(
false
);
const
[
callEvents
,
setCallEvents
]
=
useState
({});
//
const [callEvents, setCallEvents] = useState({});
const
[
transferModel
,
setTransferModel
]
=
useState
(
true
);
const
[
numpadModal
,
setNumpadModal
]
=
useState
(
false
);
useEffect
(()
=>
{
boxDialer
.
setSipStateChangeCallback
(
setCallEvents
,
'
setCallEvents
'
);
},
[]);
const
[
callEvents
,
setCallEvents
]
=
useContext
(
contextModalEventProperty
);
// useEffect(() => {
// boxDialer.setSipStateChangeCallback(setCallEvents, 'setCallEvents');
// }, []);
useEffect
(()
=>
{
setModalHidden
(
hidden
);
...
...
@@ -99,14 +102,14 @@ const Modal = ({ children, hidden, hangupButton, phoneNumber, callType }) => {
<
ModalContainer
.
Footer
justify=
{
'
space-between
'
}
rollUp=
{
rollUp
}
>
<
div
className=
'outcomingEventStyle'
>
<
div
onClick=
{
()
=>
boxDialer
.
holdButtonClick
()
}
>
{
callEvents
.
callHold
?
(
{
callEvents
?
.
callHold
?
(
<
PlayArrowIcon
style=
{
{
color
:
'
#fff
'
}
}
/>
)
:
(
<
PauseIcon
style=
{
{
color
:
'
#fff
'
}
}
/>
)
}
</
div
>
<
div
onClick=
{
()
=>
boxDialer
.
muteButtonClick
()
}
>
{
callEvents
.
callMute
?
(
{
callEvents
?
.
callMute
?
(
<
MicOffIcon
style=
{
{
color
:
'
#fff
'
}
}
/>
)
:
(
<
MicIcon
style=
{
{
color
:
'
#fff
'
}
}
/>
...
...
src/components/ModalPhoneNumpad/index.jsx
View file @
80c1e21d
...
...
@@ -29,7 +29,6 @@ const ModalPhoneNumpad = ({
const
[
exNum
,
setExNum
]
=
useState
();
const
translator
=
useTranslator
();
useEffect
(()
=>
{
let
currentCalls
=
localStorage
.
getItem
(
'
callhistory
'
)
?
JSON
.
parse
(
localStorage
.
getItem
(
'
callhistory
'
))
...
...
@@ -296,7 +295,7 @@ const ModalPhoneNumpad = ({
setExNum
(
false
);
callButton
();
}
}
>
{
title
}
(
{
number
}
)
{
title
}
</
p
>
))
}
</
NumberButton
.
CallButtonModalInset
>
...
...
src/context/index.jsx
0 → 100644
View file @
80c1e21d
/** @format */
import
React
from
'
react
'
;
import
ModalEventProperty
from
'
./modalEventProperty
'
;
const
CreateContext
=
({
children
})
=>
{
return
(
<>
<
ModalEventProperty
>
{
children
}
</
ModalEventProperty
>
</>
);
};
export
default
CreateContext
;
src/context/modalEventProperty.js
0 → 100644
View file @
80c1e21d
/** @format */
import
React
from
'
react
'
;
import
{
createContext
}
from
'
react
'
;
import
{
useEffect
}
from
'
react
'
;
import
{
useState
}
from
'
react
'
;
export
const
contextModalEventProperty
=
createContext
();
const
ModalEventProperty
=
({
children
})
=>
{
const
[
callEvents
,
setCallEvents
]
=
useState
();
const
boxDialer
=
window
.
BoxDialer
;
useEffect
(()
=>
{
boxDialer
.
setSipStateChangeCallback
(
setCallEvents
,
'
setCallEvents
'
);
},
[]);
return
(
<
contextModalEventProperty
.
Provider
value
=
{[
callEvents
,
setCallEvents
]}
>
{
children
}
<
/contextModalEventProperty.Provider
>
);
};
export
default
ModalEventProperty
;
src/index.js
View file @
80c1e21d
...
...
@@ -8,6 +8,7 @@ import Root from './root';
import
'
./index.css
'
;
import
ControlRenderBX
from
'
./lib/controlRenderBX
'
;
import
LanguageController
from
'
./lib/languageController
'
;
import
CreateContext
from
'
./context
'
;
window
.
BoxDialer
=
new
BoxDialer
();
const
container
=
document
.
getElementById
(
'
boxdialerwidjet
'
);
...
...
@@ -15,9 +16,11 @@ const root = createRoot(container);
root
.
render
(
<
React
.
StrictMode
>
<
LanguageController
>
<
Toaster
/>
<
ControlRenderBX
/>
<
/LanguageController
>
<
CreateContext
>
<
LanguageController
>
<
Toaster
/>
<
ControlRenderBX
/>
<
/LanguageController
>
<
/CreateContext
>
<
/React.StrictMode>
,
);
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