Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
telehealth-frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
8
Merge Requests
8
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
Рогов Артем Владимирович
telehealth-frontend
Commits
5f8f6af6
Unverified
Commit
5f8f6af6
authored
Nov 13, 2023
by
ksmirnov
Committed by
GitHub
Nov 13, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12 from AyaDigital/feature/DMVP-1041
DMVP-1041 - Display-of-appointment-timer
parents
dccec3f1
805a0a72
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
Timer.tsx
src/components/Timer/Timer.tsx
+54
-0
index.tsx
src/layouts/Header/index.tsx
+2
-0
No files found.
src/components/Timer/Timer.tsx
0 → 100644
View file @
5f8f6af6
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
moment
from
'moment'
;
import
{
createStyles
,
makeStyles
,
Theme
}
from
'@material-ui/core/styles'
;
const
useStyles
=
makeStyles
((
theme
:
Theme
)
=>
createStyles
({
timerBlock
:
{
display
:
'flex'
,
'column-gap'
:
'5px'
,
'align-items'
:
'center'
,
'font-weight'
:
'bold'
,
},
})
);
const
eventTime
=
moment
().
unix
();
export
default
function
Timer
(
props
:
{
disabled
?:
boolean
})
{
const
classes
=
useStyles
();
const
[
timer
,
setTimer
]
=
useState
(
''
);
const
interval
=
1000
;
setInterval
(()
=>
{
const
currentTime
=
moment
().
unix
();
const
diffTime
=
currentTime
-
eventTime
;
const
duration
=
moment
.
duration
(
diffTime
,
'seconds'
);
const
innerText
=
String
(
duration
.
hours
()).
padStart
(
2
,
'0'
)
+
' : '
+
String
(
duration
.
minutes
()).
padStart
(
2
,
'0'
)
+
' : '
+
String
(
duration
.
seconds
()).
padStart
(
2
,
'0'
);
setTimeout
(()
=>
{
setTimer
(
innerText
);
},
100
);
},
interval
);
useEffect
(()
=>
{
return
()
=>
{
setTimer
(
''
);
};
},
[]);
return
(
<
div
className=
{
classes
.
timerBlock
}
>
<
span
>
Timer call:
</
span
>
<
span
>
{
timer
}
</
span
>
</
div
>
);
}
src/layouts/Header/index.tsx
View file @
5f8f6af6
...
...
@@ -7,6 +7,7 @@ import ToggleAudioButton from '../../components/Buttons/ToggleAudioButton/Toggle
import
ToggleVideoButton
from
'../../components/Buttons/ToggleVideoButton/ToggleVideoButton'
;
import
ToggleScreenShareButton
from
'../../components/Buttons/ToogleScreenShareButton/ToggleScreenShareButton'
;
import
ToggleSpeakerViewButton
from
'../../components/Buttons/ToggleSpeakerView/ToggleSpeakerView'
;
import
Timer
from
'../../components/Timer/Timer'
;
import
Menu
from
'../../components/MenuBar/Menu/MenuHeader'
;
import
useVideoContext
from
'../../hooks/useVideoContext/useVideoContext'
;
import
{
isMobile
}
from
'../../utils'
;
...
...
@@ -70,6 +71,7 @@ export const Header: React.FC<HeaderProps> = () => {
{
!
isSharingScreen
&&
<
ToggleScreenShareButton
disabled=
{
isReconnecting
}
/>
}
{
isSharingScreen
&&
<
Button
onClick=
{
()
=>
toggleScreenShare
()
}
>
Stop Sharing
</
Button
>
}
<
ToggleSpeakerViewButton
disabled=
{
isReconnecting
}
/>
<
Timer
/>
</
Grid
>
</
Grid
>
)
:
null
}
...
...
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