Skip to content

Commit

Permalink
adding file selection handle to parent form
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-laverty committed Sep 14, 2024
1 parent 53ea2be commit dc746d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/session/form/[sessionId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useRouter, useParams } from 'next/navigation';
import { useState, useEffect } from 'react';
import { Session } from '@/lib/types';
import MultiVideoUpload from './components/MultiVideoUpload';
import MultiVideoSelect from './components/MultiVideoSelect';
import BackButton from './components/BackButton';

import { useForm, SubmitHandler } from "react-hook-form"
Expand All @@ -21,6 +21,7 @@ const SessionForm: React.FC = () => {
const params = useParams();
const sessionId = params?.sessionId as string;
const [sessionData, setSessionData] = useState<Partial<Session>>({});
const [selectedFiles, setSelectedFiles] = useState<File[]>([]);

const {
register,
Expand Down Expand Up @@ -79,7 +80,7 @@ const SessionForm: React.FC = () => {
<input className={`form-input border px-2 rounded-md ${errors.board ? 'border-purple-500 border-2' : 'border-gray-300'}`} type="text" {...register("board", { required: true })} />
</div>

<MultiVideoUpload />
<MultiVideoSelect onFilesChange={setSelectedFiles} />

<button
type="submit"
Expand Down

0 comments on commit dc746d7

Please sign in to comment.