Skip to content

Commit 38d6091

Browse files
Squash lesson plan
1 parent 02de70a commit 38d6091

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

src/components/DeclareAbsenceForm.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,12 @@ const DeclareAbsenceForm: React.FC<DeclareAbsenceFormProps> = ({
271271
<FormErrorMessage>{errors.reasonOfAbsence}</FormErrorMessage>
272272
</FormControl>
273273

274-
<FileUpload lessonPlan={lessonPlan} setLessonPlan={setLessonPlan} />
274+
<FormControl>
275+
<Text textStyle="h4" mb={2}>
276+
Lesson Plan
277+
</Text>
278+
<FileUpload lessonPlan={lessonPlan} setLessonPlan={setLessonPlan} />
279+
</FormControl>
275280

276281
<FormControl>
277282
<FormLabel htmlFor="notes" sx={{ display: 'flex' }}>

src/components/EditAbsenceForm.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,16 @@ const EditAbsenceForm: React.FC<EditAbsenceFormProps> = ({
274274
<FormErrorMessage>{errors.reasonOfAbsence}</FormErrorMessage>
275275
</FormControl>
276276

277-
<FileUpload
278-
lessonPlan={lessonPlan}
279-
setLessonPlan={setLessonPlan}
280-
existingFile={existingLessonPlan}
281-
/>
277+
<FormControl>
278+
<Text textStyle="h4" mb={2}>
279+
Lesson Plan
280+
</Text>
281+
<FileUpload
282+
lessonPlan={lessonPlan}
283+
setLessonPlan={setLessonPlan}
284+
existingFile={existingLessonPlan}
285+
/>
286+
</FormControl>
282287

283288
<FormControl>
284289
<FormLabel htmlFor="notes" sx={{ display: 'flex' }}>

src/components/FileUpload.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ interface FileUploadProps {
1313
lessonPlan: File | null;
1414
setLessonPlan: (file: File | null) => void;
1515
existingFile?: LessonPlanFile | null;
16-
label?: string;
1716
}
1817

1918
export const FileUpload: React.FC<FileUploadProps> = ({
2019
lessonPlan,
2120
setLessonPlan,
2221
existingFile,
23-
label = 'Lesson Plan',
2422
}) => {
2523
const [isDragging, setIsDragging] = useState(false);
2624
const inputRef = useRef<HTMLInputElement>(null);
@@ -66,10 +64,7 @@ export const FileUpload: React.FC<FileUploadProps> = ({
6664
};
6765

6866
return (
69-
<FormControl>
70-
<Text textStyle="h4" mb={2}>
71-
{label}
72-
</Text>
67+
<>
7368
<Box
7469
as="label"
7570
htmlFor="fileUpload"
@@ -106,6 +101,6 @@ export const FileUpload: React.FC<FileUploadProps> = ({
106101
accept="application/pdf"
107102
display="none"
108103
/>
109-
</FormControl>
104+
</>
110105
);
111106
};

0 commit comments

Comments
 (0)