Skip to content

Commit

Permalink
feat: adds video link to input
Browse files Browse the repository at this point in the history
  • Loading branch information
yokwejuste committed Mar 1, 2024
1 parent e41dc40 commit 75c20d9
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Box, CardMedia, FormControl, TextField, Typography, makeStyles } from '
import { ClearRounded, CloudUploadOutlined } from '@material-ui/icons';
import clsx from 'clsx';
import _ from 'lodash';
import React, { useRef } from 'react';
import React, { useRef, useEffect } from 'react';
import styles from '../../../assets/js/styles';
import { isGdriveORVimeoORYoutube } from '../../../views/project_details/projectDetailsScripts';
import { refactorVideoUrl } from '../../input/inputScripts';
Expand All @@ -14,7 +14,7 @@ function VideoInput({ name, label, required, value = [], handleChange, linkValue
const classes = makeStyles(videoInputStyles)();
const input = useRef(null);
const videoRef = useRef(null);
const clickCount = 0;
var clickCount = 0;

const handleFileChange = files => {
const maxAssets = 1;
Expand Down Expand Up @@ -75,6 +75,11 @@ function VideoInput({ name, label, required, value = [], handleChange, linkValue
handleChange('', 'link');
};

useEffect(() => {
if (linkValue) {
handleChange(linkValue, 'link');
}
}, [linkValue, handleChange]);
const uploadedVideo = () => {
if (typeof value !== 'string' && value?.length > 0) {
return value?.map((asset, index) => (
Expand Down

0 comments on commit 75c20d9

Please sign in to comment.