Commit 746357f2 authored by ThushanSandeepa's avatar ThushanSandeepa

added video details

parent b0b111f3
...@@ -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 110px', padding: ' 10px 150px 10px 150px',
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="h3" sx={{ color: 'grey', opacity: 0.5 }}> <Typography variant="h4" 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>
); );
......
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment