diff --git a/src/components/atoms/Input/index.module.css b/src/components/atoms/Input/index.module.css index a7e4c5b1f..e56057d0f 100644 --- a/src/components/atoms/Input/index.module.css +++ b/src/components/atoms/Input/index.module.css @@ -3,6 +3,11 @@ position: relative; } +.field[data-is-submitting] { + pointer-events: none; + opacity: 0.4; +} + .field .field { margin-bottom: calc(var(--spacer) / 2); } diff --git a/src/components/atoms/Input/index.tsx b/src/components/atoms/Input/index.tsx index 5c461bb01..f221df6cd 100644 --- a/src/components/atoms/Input/index.tsx +++ b/src/components/atoms/Input/index.tsx @@ -3,7 +3,8 @@ import InputElement from './InputElement' import Help from './Help' import Label from './Label' import styles from './index.module.css' -import { ErrorMessage } from 'formik' +import { ErrorMessage, FormikState, FieldProps, FieldInputProps } from 'formik' +import { MetadataPublishForm } from '../../../@types/Metadata' export interface InputProps { name: string @@ -28,19 +29,18 @@ export interface InputProps { pattern?: string min?: string disabled?: boolean - field?: { - name: string - value: string - onChange: () => void - onBlur: () => void - } + field?: FieldInputProps + form?: FormikState } export default function Input(props: Partial): ReactElement { const { required, name, label, help, additionalComponent, field } = props return ( -
+
diff --git a/src/components/pages/Publish/PublishForm.tsx b/src/components/pages/Publish/PublishForm.tsx index a9c994ee1..62f17855c 100644 --- a/src/components/pages/Publish/PublishForm.tsx +++ b/src/components/pages/Publish/PublishForm.tsx @@ -86,7 +86,7 @@ export default function PublishForm({ ]) // User feedback and redirect to new asset detail page - toast.success('asset created successfully') + ddo && toast.success('asset created successfully') toast.dismiss(submittingToast) // TODO: reset form state and make sure persistant form in localStorage is cleared