Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-066
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
2022-066
2022-066
Commits
746357f2
Commit
746357f2
authored
Nov 15, 2022
by
ThushanSandeepa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added video details
parent
b0b111f3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
frontend/src/classNotes/DropZone.js
frontend/src/classNotes/DropZone.js
+10
-10
frontend/src/classNotes/classNotes.js
frontend/src/classNotes/classNotes.js
+3
-1
No files found.
frontend/src/classNotes/DropZone.js
View file @
746357f2
...
@@ -10,7 +10,7 @@ import { useDispatch, useSelector } from 'react-redux';
...
@@ -10,7 +10,7 @@ import { useDispatch, useSelector } from 'react-redux';
import
VideoFileOutlinedIcon
from
'
@mui/icons-material/VideoFileOutlined
'
;
import
VideoFileOutlinedIcon
from
'
@mui/icons-material/VideoFileOutlined
'
;
function
DropZone
(
props
)
{
function
DropZone
(
props
)
{
const
{
fileSelectedHandler
}
=
props
;
const
{
fileSelectedHandler
,
isFilePicked
,
file
}
=
props
;
const
diffWordsData
=
useSelector
((
state
)
=>
state
.
diffwords
);
const
diffWordsData
=
useSelector
((
state
)
=>
state
.
diffwords
);
const
{
acceptedFiles
,
getRootProps
,
getInputProps
}
=
useDropzone
({
const
{
acceptedFiles
,
getRootProps
,
getInputProps
}
=
useDropzone
({
accept
:
{
accept
:
{
...
@@ -47,12 +47,12 @@ function DropZone(props) {
...
@@ -47,12 +47,12 @@ function DropZone(props) {
{...
getRootProps
({
className
:
'
dropzone
'
})}
{...
getRootProps
({
className
:
'
dropzone
'
})}
style
=
{{
style
=
{{
border
:
'
3px dashed rgba(128, 128, 128, .3)
'
,
border
:
'
3px dashed rgba(128, 128, 128, .3)
'
,
padding
:
'
100px 150px 100px 150px
'
,
padding
:
!
isFilePicked
?
'
100px 150px 100px 150px
'
:
'
30px 150px 30px 150px
'
,
backgroundColor
:
'
white
'
backgroundColor
:
'
white
'
}}
}}
>
>
<
input
{...
getInputProps
()}
/
>
<
input
{...
getInputProps
()}
/
>
{
/* {!diffWordsData.isFilePicked && ( */
}
{
!
isFilePicked
&&
(
<>
<>
<
center
>
<
center
>
<
AttachFileIcon
sx
=
{{
fontSize
:
'
60px
'
}}
style
=
{{
color
:
'
grey
'
,
opacity
:
0.3
}}
/
>
<
AttachFileIcon
sx
=
{{
fontSize
:
'
60px
'
}}
style
=
{{
color
:
'
grey
'
,
opacity
:
0.3
}}
/
>
...
@@ -62,14 +62,14 @@ function DropZone(props) {
...
@@ -62,14 +62,14 @@ function DropZone(props) {
Drag
and
drop
or
click
to
select
Videos
Drag
and
drop
or
click
to
select
Videos
<
/Typography
>
<
/Typography
>
<
/
>
<
/
>
{
/* )} */
}
)}
{
/*
<aside>
<
aside
>
{
diffWordsData.
isFilePicked && (
{
isFilePicked
&&
(
<
div
<
div
style
=
{{
style
=
{{
border
:
'
3px dashed rgba(128, 128, 128, .3)
'
,
border
:
'
3px dashed rgba(128, 128, 128, .3)
'
,
padding: '
70px 110px 70px 11
0px',
padding
:
'
10px 150px 10px 15
0px
'
,
backgroundColor
:
'
white
'
backgroundColor
:
'
white
'
}}
}}
>
>
...
@@ -78,14 +78,14 @@ function DropZone(props) {
...
@@ -78,14 +78,14 @@ function DropZone(props) {
<
VideoFileOutlinedIcon
color
=
"
primary
"
sx
=
{{
fontSize
:
'
150px
'
}}
/
>
<
VideoFileOutlinedIcon
color
=
"
primary
"
sx
=
{{
fontSize
:
'
150px
'
}}
/
>
<
/Grid
>
<
/Grid
>
<
Grid
item
>
<
Grid
item
>
<Typography variant="h
3
" sx={{ color: 'grey', opacity: 0.5 }}>
<
Typography
variant
=
"
h
4
"
sx
=
{{
color
:
'
grey
'
,
opacity
:
0.5
}}
>
{
diffWordsData.file[0].name}- {formatBytes(diffWordsData.
file[0].size)}
{
file
[
0
].
name
}
-
{
formatBytes
(
file
[
0
].
size
)}
<
/Typography
>
<
/Typography
>
<
/Grid
>
<
/Grid
>
<
/Grid
>
<
/Grid
>
<
/div
>
<
/div
>
)}
)}
</aside>
*/
}
<
/aside
>
<
/div
>
<
/div
>
<
/section
>
<
/section
>
);
);
...
...
frontend/src/classNotes/classNotes.js
View file @
746357f2
...
@@ -6,10 +6,12 @@ import Grid from "@mui/material/Grid"
...
@@ -6,10 +6,12 @@ import Grid from "@mui/material/Grid"
const
ClassNotes
=
()
=>
{
const
ClassNotes
=
()
=>
{
const
[
file
,
setFile
]
=
useState
([])
const
[
file
,
setFile
]
=
useState
([])
const
[
isFilePicked
,
setIsFilePicked
]
=
useState
(
false
)
const
fileSelectedHandler
=
(
file
)
=>
{
const
fileSelectedHandler
=
(
file
)
=>
{
// console.log('diff data', diffWordsData);
// console.log('diff data', diffWordsData);
setFile
(
file
);
setFile
(
file
);
setIsFilePicked
(
true
)
// dispatch({ type: SET_FILE_PICKED, file });
// dispatch({ type: SET_FILE_PICKED, file });
};
};
return
(
return
(
...
@@ -17,7 +19,7 @@ const ClassNotes = () => {
...
@@ -17,7 +19,7 @@ const ClassNotes = () => {
<
Grid
container
direction
=
"
column
"
alignItems
=
"
center
"
spacing
=
{
2
}
style
=
{{
marginTop
:
"
1rem
"
}}
>
<
Grid
container
direction
=
"
column
"
alignItems
=
"
center
"
spacing
=
{
2
}
style
=
{{
marginTop
:
"
1rem
"
}}
>
<
Grid
item
xs
=
{
2
}
>
<
Grid
item
xs
=
{
2
}
>
<
DropZone
fileSelectedHandler
=
{
fileSelectedHandler
}
/
>
<
DropZone
fileSelectedHandler
=
{
fileSelectedHandler
}
isFilePicked
=
{
isFilePicked
}
file
=
{
file
}
/
>
<
/Grid
>
<
/Grid
>
<
Grid
item
>
<
Grid
item
>
<
LoadingButton
<
LoadingButton
...
...
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