diff --git a/Accounts/src/Index.tsx b/Accounts/src/Index.tsx index c816ffcee0..5b3ec199dc 100644 --- a/Accounts/src/Index.tsx +++ b/Accounts/src/Index.tsx @@ -3,7 +3,7 @@ import 'CommonUI/src/Styles/Bootstrap'; import ReactDOM from 'react-dom/client'; import App from './App'; -const root = ReactDOM.createRoot( +const root: any = ReactDOM.createRoot( document.getElementById('root') as HTMLElement ); diff --git a/CommonUI/src/Components/Dashboard/TopBar/TopBar.tsx b/CommonUI/src/Components/Dashboard/TopBar/TopBar.tsx index f8454d4ec1..32b8ed878a 100644 --- a/CommonUI/src/Components/Dashboard/TopBar/TopBar.tsx +++ b/CommonUI/src/Components/Dashboard/TopBar/TopBar.tsx @@ -16,7 +16,7 @@ const TopBar: FunctionComponent = ({ rightContents, middleContents, navContents, -}): ReactElement => { +}: ComponentProps): ReactElement => { return (
diff --git a/CommonUI/src/Components/Dashboard/TopBar/TopbarMenu/MenuLinkItem.tsx b/CommonUI/src/Components/Dashboard/TopBar/TopbarMenu/MenuLinkItem.tsx index e9d47ae993..f95940bcc6 100644 --- a/CommonUI/src/Components/Dashboard/TopBar/TopbarMenu/MenuLinkItem.tsx +++ b/CommonUI/src/Components/Dashboard/TopBar/TopbarMenu/MenuLinkItem.tsx @@ -12,7 +12,7 @@ export interface ComponentProps { const MenuLinkItem: FunctionComponent = ({ text, openInNewTab, -}): ReactElement => { +}: ComponentProps): ReactElement => { return (
diff --git a/CommonUI/src/Components/Dashboard/TopBar/TopbarMenuButton/MenuButton.tsx b/CommonUI/src/Components/Dashboard/TopBar/TopbarMenuButton/MenuButton.tsx index 07cef9fcf5..a34cbebb34 100644 --- a/CommonUI/src/Components/Dashboard/TopBar/TopbarMenuButton/MenuButton.tsx +++ b/CommonUI/src/Components/Dashboard/TopBar/TopbarMenuButton/MenuButton.tsx @@ -8,20 +8,26 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import './MenuButton.scss'; -export interface ComponentProps { - text?: string; +export interface MenuIconButtonComponentProps { icon?: IconProp; action?: MouseEventHandler; modalContent?: ReactElement; showModal?: boolean; } -export const MenuIconButton: FunctionComponent = ({ +export interface MenuOutlineButtonComponentProps + extends MenuIconButtonComponentProps { + text?: string; +} + +export const MenuIconButton: FunctionComponent< + MenuIconButtonComponentProps +> = ({ icon, action, showModal, modalContent, -}: ComponentProps): ReactElement => { +}: MenuIconButtonComponentProps): ReactElement => { return (
@@ -32,13 +38,15 @@ export const MenuIconButton: FunctionComponent = ({ ); }; -export const MenuOutlineButton: FunctionComponent = ({ +export const MenuOutlineButton: FunctionComponent< + MenuOutlineButtonComponentProps +> = ({ text, icon, action, showModal, modalContent, -}: ComponentProps): ReactElement => { +}: MenuOutlineButtonComponentProps): ReactElement => { return (
@@ -50,13 +58,13 @@ export const MenuOutlineButton: FunctionComponent = ({ ); }; -const MenuButton: FunctionComponent = ({ +const MenuButton: FunctionComponent = ({ text, icon, action, showModal, modalContent, -}): ReactElement => { +}: MenuOutlineButtonComponentProps): ReactElement => { return (
diff --git a/CommonUI/src/Components/Forms/BasicForm.tsx b/CommonUI/src/Components/Forms/BasicForm.tsx index eaf19dcd18..d1ba95d01a 100644 --- a/CommonUI/src/Components/Forms/BasicForm.tsx +++ b/CommonUI/src/Components/Forms/BasicForm.tsx @@ -63,11 +63,10 @@ const BasicForm: FunctionComponent = ( {field.sideLink?.text} @@ -104,17 +103,15 @@ const BasicForm: FunctionComponent = ( if (field.validation) { if (field.validation.minLength) { if (content.trim().length < field.validation?.minLength) { - return `${field.title || name} cannot be less than ${ - field.validation.minLength - } characters.`; + return `${field.title || name} cannot be less than ${field.validation.minLength + } characters.`; } } if (field.validation.maxLength) { if (content.trim().length > field.validation?.maxLength) { - return `${field.title || name} cannot be more than ${ - field.validation.maxLength - } characters.`; + return `${field.title || name} cannot be more than ${field.validation.maxLength + } characters.`; } } } @@ -141,7 +138,7 @@ const BasicForm: FunctionComponent = ( field.validation?.toMatchField && entity[field.validation?.toMatchField] && (entity[field.validation?.toMatchField] as string).trim() !== - content.trim() + content.trim() ) { return `${field.title} should match ${field.validation?.toMatchField}`; } @@ -238,42 +235,34 @@ const BasicForm: FunctionComponent = ( setSubmitting(false); }} > - {({ - isSubmitting, - isValid, - }: { - isSubmitting: boolean; - isValid: boolean; - }) => { - return ( -
-

{props.title}

-

{props.description}

+ +

{props.title}

+ +

{props.description}

+ +
+ {props.fields && + props.fields.map( + (field: DataField, i: number) => { + return getFormField(field, i); + } + )} +
+ +
); diff --git a/Dashboard/src/index.tsx b/Dashboard/src/index.tsx index 82b32538f2..6afc883c54 100644 --- a/Dashboard/src/index.tsx +++ b/Dashboard/src/index.tsx @@ -6,7 +6,7 @@ import 'CommonUI/src/Styles/Bootstrap'; import ReactDOM from 'react-dom/client'; import App from './App'; -const root = ReactDOM.createRoot( +const root: any = ReactDOM.createRoot( document.getElementById('root') as HTMLElement );