From c30a8ce185ee4a9542f39ef23250300215339d13 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Garcia Date: Fri, 11 Aug 2023 11:40:40 +0200 Subject: [PATCH] Fix various components types --- .../atoms/inputs/FieldsetWrapper.tsx | 2 +- .../src/components/atoms/inputs/Input.tsx | 2 +- .../src/components/atoms/inputs/Label.tsx | 2 +- .../components/molecules/ListHeader/index.tsx | 2 +- .../molecules/TablePagination/index.tsx | 2 +- .../src/components/organisms/AuthContext.tsx | 10 ++++--- .../InstructorEnrollmentListFilters/index.tsx | 21 ++++++++------- .../templates/Form/HideSectionsContainer.tsx | 4 ++- .../hooks/use-form-submission.test.tsx | 4 ++- .../hooks/use-form-submission.ts | 11 +++++--- .../templates/Form/SubmissionPanel/index.tsx | 26 +++++++++++++------ .../templates/hooks/use-full-data-provider.ts | 9 +++++-- frontend/src/services/enrollments.test.ts | 3 ++- 13 files changed, 64 insertions(+), 34 deletions(-) diff --git a/frontend/src/components/atoms/inputs/FieldsetWrapper.tsx b/frontend/src/components/atoms/inputs/FieldsetWrapper.tsx index f20c5edbe..b836fb009 100644 --- a/frontend/src/components/atoms/inputs/FieldsetWrapper.tsx +++ b/frontend/src/components/atoms/inputs/FieldsetWrapper.tsx @@ -1,7 +1,7 @@ import './FieldsetWrapper.css'; type FieldsetWrapperProps = { - title?: string; + title?: string | React.ReactNode; required?: boolean; grid?: boolean; inline?: boolean; diff --git a/frontend/src/components/atoms/inputs/Input.tsx b/frontend/src/components/atoms/inputs/Input.tsx index d2ece0158..ca9cd552f 100644 --- a/frontend/src/components/atoms/inputs/Input.tsx +++ b/frontend/src/components/atoms/inputs/Input.tsx @@ -5,7 +5,7 @@ import Label from './Label'; export interface InputProps extends InputHTMLAttributes { label?: string; helper?: string; - meta?: string; + meta?: string | React.ReactNode; ariaLabel?: string; } diff --git a/frontend/src/components/atoms/inputs/Label.tsx b/frontend/src/components/atoms/inputs/Label.tsx index 7bde4ba83..9614024c6 100644 --- a/frontend/src/components/atoms/inputs/Label.tsx +++ b/frontend/src/components/atoms/inputs/Label.tsx @@ -6,7 +6,7 @@ type Props = { label: ReactNode; required?: boolean; helper?: string; - meta?: string; + meta?: string | React.ReactNode; }; export const Label: FunctionComponent = ({ diff --git a/frontend/src/components/molecules/ListHeader/index.tsx b/frontend/src/components/molecules/ListHeader/index.tsx index 709d3f930..d70c84b5d 100644 --- a/frontend/src/components/molecules/ListHeader/index.tsx +++ b/frontend/src/components/molecules/ListHeader/index.tsx @@ -3,7 +3,7 @@ import './style.css'; type Props = { title: string; - children: React.ReactNode; + children?: React.ReactNode; }; export const ListHeader: React.FC = ({ title, children = null }) => { diff --git a/frontend/src/components/molecules/TablePagination/index.tsx b/frontend/src/components/molecules/TablePagination/index.tsx index b56f33ad8..118b8506f 100644 --- a/frontend/src/components/molecules/TablePagination/index.tsx +++ b/frontend/src/components/molecules/TablePagination/index.tsx @@ -3,7 +3,7 @@ import NumberInput from '../../atoms/inputs/NumberInput'; import './style.css'; import { Table } from '@tanstack/react-table'; -const TablePagination = ({ table }: { table: Table }) => { +const TablePagination = ({ table }: { table: Table }) => { return (