Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2023-029
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2023-029
2023-029
Commits
1ab89cbd
Commit
1ab89cbd
authored
Aug 27, 2023
by
Paranagama R.P.S.D.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat : Cosmetic changes
parent
9f60708f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
65 deletions
+21
-65
Project/Frontend/SignConnectPlus/src/pages/ssl-translate/process/WebcamStreamCapture.tsx
...s/src/pages/ssl-translate/process/WebcamStreamCapture.tsx
+3
-11
Project/Frontend/SignConnectPlus/src/pages/ssl-translate/process/process.tsx
...gnConnectPlus/src/pages/ssl-translate/process/process.tsx
+18
-54
No files found.
Project/Frontend/SignConnectPlus/src/pages/ssl-translate/process/WebcamStreamCapture.tsx
View file @
1ab89cbd
import
{
useRef
,
useState
}
from
'
react
'
;
import
{
Button
,
Grid
}
from
'
@mui/material
'
;
import
Webcam
from
'
react-webcam
'
;
import
{
PauseCircleOutlined
,
PlayCircleOutlined
}
from
'
@ant-design/icons
'
;
//@ts-ignore
const
WebcamStreamCapture
=
({
onVideoRecorded
})
=>
{
const
webcamRef
=
useRef
(
null
);
...
...
@@ -54,20 +55,11 @@ const WebcamStreamCapture = ({ onVideoRecorded }) => {
<
Grid
item
xs=
{
12
}
>
<
center
>
{
capturing
?
(
// ! Add Icon
// <Button onClick=
{
handleStopCaptureClick
}
startIcon
=
{
<
StopIcon
/>
}
color
=
"
error
"
variant
=
"
contained
"
>
// Stop Capture
// </Button>
<
Button
onClick=
{
handleStopCaptureClick
}
color=
"error"
variant=
"contained"
>
<
Button
onClick=
{
handleStopCaptureClick
}
startIcon=
{
<
PauseCircleOutlined
/>
}
color=
"error"
variant=
"contained"
>
Stop Capture
</
Button
>
)
:
(
// ! Add Icon
// <Button onClick=
{
handleStartCaptureClick
}
startIcon
=
{
<
RadioButtonCheckedIcon
/>
}
color
=
"
error
"
variant
=
"
contained
"
>
// Start Capture
// </Button>
<
Button
onClick=
{
handleStartCaptureClick
}
color=
"error"
variant=
"contained"
>
<
Button
onClick=
{
handleStartCaptureClick
}
startIcon=
{
<
PlayCircleOutlined
/>
}
color=
"error"
variant=
"contained"
>
Start Capture
</
Button
>
)
}
...
...
Project/Frontend/SignConnectPlus/src/pages/ssl-translate/process/process.tsx
View file @
1ab89cbd
...
...
@@ -11,6 +11,7 @@ import {
CardHeader
,
Container
,
Grid
,
IconButton
,
InputAdornment
,
LinearProgress
,
Paper
,
...
...
@@ -26,6 +27,7 @@ import { useState } from 'react';
import
{
useSnackbar
}
from
'
notistack
'
;
import
{
CloudUploadOutlined
,
CopyOutlined
,
TranslationOutlined
,
VideoCameraOutlined
}
from
'
@ant-design/icons
'
;
import
{
MuiFileInput
}
from
'
mui-file-input
'
;
import
SignLanguageToTextService
from
'
../../../services/SignLanguageToText.js
'
;
import
WebcamStreamCapture
from
'
./WebcamStreamCapture
'
;
...
...
@@ -45,19 +47,6 @@ const Process = () => {
const
[
speed
,
setSpeed
]
=
useState
(
0
);
const
[
recordedVideoUrl
,
setRecordedVideoUrl
]
=
useState
(
null
);
// const handleDropSingleFile = useCallback(async (acceptedFiles: File[]) => {
// const file = acceptedFiles[0];
// if (file) {
// setFile(
// Object.assign(file, {
// preview: URL.createObjectURL(file)
// })
// );
// setVideoUrl(URL.createObjectURL(file));
// }
// }, []);
const
handleDropSingleFile
=
(
files
:
any
)
=>
{
if
(
files
)
{
setFile
(
...
...
@@ -87,14 +76,12 @@ const Process = () => {
const
{
enqueueSnackbar
}
=
useSnackbar
();
// const { copy } = useCopyToClipboard();
// const onCopy = (text: string) => {
// if (text) {
// enqueueSnackbar('Copied!');
// copy(text);
// }
// };
const
onCopy
=
(
text
:
string
)
=>
{
if
(
text
)
{
navigator
.
clipboard
.
writeText
(
text
);
enqueueSnackbar
(
'
Copied!
'
,
{
variant
:
'
success
'
});
}
};
const
handleChange
=
(
event
:
React
.
ChangeEvent
<
HTMLTextAreaElement
>
)
=>
{
setValue
(
event
.
target
.
value
);
...
...
@@ -177,45 +164,25 @@ const Process = () => {
}
}
>
<
ButtonGroup
disableElevation
variant=
"contained"
aria
-
label=
"Disabled elevation buttons"
>
{
/* ! Important - Add Icon */
}
<
Button
variant=
{
checkTranalationTypeForUpload
()
}
startIcon=
{
<
CloudUploadOutlined
/>
}
onClick=
{
()
=>
{
setIsUploadFile
(
true
);
}
}
>
Upload
</
Button
>
{
/* <Button
variant={checkTranalationTypeForUpload()}
startIcon={<UploadIcon />}
onClick={() => {
setIsUploadFile(true);
}}
>
Upload
</Button> */
}
{
/* ! Important - Add Icon */
}
<
Button
variant=
{
checkTranalationTypeForRecord
()
}
startIcon=
{
<
VideoCameraOutlined
/>
}
onClick=
{
()
=>
{
setIsUploadFile
(
false
);
}
}
>
Record
</
Button
>
{
/*
<Button
variant={checkTranalationTypeForRecord()}
startIcon={<EmergencyRecordingIcon />}
onClick={() => {
setIsUploadFile(false);
}}
>
Record
</Button> */
}
</
ButtonGroup
>
{
isUploadFile
?
(
<
Box
sx=
{
{
flexGrow
:
1
}
}
>
...
...
@@ -273,6 +240,7 @@ const Process = () => {
onClick=
{
()
=>
{
translateSignLanguageToText
();
}
}
endIcon=
{
<
TranslationOutlined
/>
}
>
Translate
</
Button
>
...
...
@@ -302,12 +270,9 @@ const Process = () => {
InputProps=
{
{
endAdornment
:
(
<
InputAdornment
position=
"end"
>
{
/* <Tooltip title="Copy"> */
}
{
/* Important */
}
{
/* <IconButton onClick={() => onCopy(value)}>
<Iconify icon="eva:copy-fill" width={24} />
</IconButton> */
}
{
/* </Tooltip> */
}
<
IconButton
onClick=
{
()
=>
onCopy
(
value
)
}
>
<
CopyOutlined
/>
</
IconButton
>
</
InputAdornment
>
)
}
}
...
...
@@ -373,6 +338,7 @@ const Process = () => {
onClick=
{
()
=>
{
translateSignLanguageToTextRecord
();
}
}
endIcon=
{
<
TranslationOutlined
/>
}
>
Translate
</
Button
>
...
...
@@ -402,11 +368,9 @@ const Process = () => {
InputProps=
{
{
endAdornment
:
(
<
InputAdornment
position=
"end"
>
{
/* <Tooltip title="Copy"> */
}
{
/* <IconButton onClick={() => onCopy(value)}>
<Iconify icon="eva:copy-fill" width={24} />
</IconButton> */
}
{
/* </Tooltip> */
}
<
IconButton
onClick=
{
()
=>
onCopy
(
value
)
}
>
<
CopyOutlined
/>
</
IconButton
>
</
InputAdornment
>
)
}
}
...
...
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