diff --git a/.gitignore b/.gitignore index 6a6c384ea..3b42cabb9 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ public .cache storybook-static public/storybook -.artifacts \ No newline at end of file +.artifacts +.vercel \ No newline at end of file diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index b7b54e29c..99871a894 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -1,5 +1,4 @@ import React, { ReactNode, ReactElement } from 'react' -import { Helmet } from 'react-helmet' import Header from './organisms/Header' import Footer from './organisms/Footer' import PageHeader from './molecules/PageHeader' @@ -24,12 +23,6 @@ export default function Layout({ }: LayoutProps): ReactElement { return (
- - - - - -
diff --git a/src/components/molecules/FilesInput/Input.tsx b/src/components/molecules/FilesInput/Input.tsx index 5f62b1e64..4e697a2b9 100644 --- a/src/components/molecules/FilesInput/Input.tsx +++ b/src/components/molecules/FilesInput/Input.tsx @@ -4,16 +4,19 @@ import Button from '../../atoms/Button' import { useField } from 'formik' import Loader from '../../atoms/Loader' import InputElement from '../../atoms/Input/InputElement' +import { InputProps } from '../../atoms/Input' -export default function FileInput({ - handleButtonClick, - isLoading, - ...props -}: { - handleButtonClick(e: React.SyntheticEvent, data: string): void - isLoading: boolean -}): ReactElement { - const [field] = useField(props as any) +export default function FileInput( + { + handleButtonClick, + isLoading + }: { + handleButtonClick(e: React.SyntheticEvent, data: string): void + isLoading: boolean + }, + props: InputProps +): ReactElement { + const [field, meta] = useField(props) return ( <> diff --git a/src/components/molecules/FilesInput/index.tsx b/src/components/molecules/FilesInput/index.tsx index 6493ad72b..c6be8fb6a 100644 --- a/src/components/molecules/FilesInput/index.tsx +++ b/src/components/molecules/FilesInput/index.tsx @@ -1,19 +1,17 @@ import React, { ReactElement, useState } from 'react' -import { useField, FormikProps } from 'formik' -import { File } from '@oceanprotocol/squid' +import { useField } from 'formik' import { toast } from 'react-toastify' import FileInfo from './Info' import FileInput from './Input' import { getFileInfo } from '../../../utils' +import { InputProps } from '../../atoms/Input' interface Values { url: string } -export default function FilesInput( - props: FormikProps -): ReactElement { - const [field, meta, helpers] = useField(props as any) +export default function FilesInput(props: InputProps): ReactElement { + const [field, meta, helpers] = useField(props) const [isLoading, setIsLoading] = useState(false) async function handleButtonClick(e: React.SyntheticEvent, url: string) { diff --git a/src/components/pages/Publish/PublishForm.module.css b/src/components/pages/Publish/PublishForm.module.css index 5ab67557a..0c3b33ffe 100644 --- a/src/components/pages/Publish/PublishForm.module.css +++ b/src/components/pages/Publish/PublishForm.module.css @@ -1,13 +1,3 @@ .form { composes: box from '../../atoms/Box.module.css'; } - -.error { - background-color: var(--red); -} -.success { - background-color: var(--green); -} -.info { - background-color: var(--yellow); -} diff --git a/src/components/pages/Publish/PublishForm.tsx b/src/components/pages/Publish/PublishForm.tsx index 159842afb..84eaf4af8 100644 --- a/src/components/pages/Publish/PublishForm.tsx +++ b/src/components/pages/Publish/PublishForm.tsx @@ -15,13 +15,14 @@ import { transformPublishFormToMetadata } from './utils' import { FormContent, FormFieldProps } from '../../../@types/Form' import { MetaDataPublishForm, AccessType } from '../../../@types/MetaData' import AssetModel from '../../../models/Asset' +import { File } from '@oceanprotocol/squid' const validationSchema = Yup.object().shape({ // ---- required fields ---- name: Yup.string().required('Required'), author: Yup.string().required('Required'), price: Yup.string().required('Required'), - files: Yup.string().required('Required'), + files: Yup.object().required('Required'), description: Yup.string().required('Required'), license: Yup.string().required('Required'), access: Yup.string().required('Required'), @@ -30,7 +31,7 @@ const validationSchema = Yup.object().shape({ // ---- optional fields ---- copyrightHolder: Yup.string(), tags: Yup.string(), - links: Yup.string() + links: Yup.object() }) const initialValues: MetaDataPublishForm = { @@ -55,9 +56,7 @@ export default function PublishForm({ const { ocean, account } = useOcean() async function handleSubmit(values: MetaDataPublishForm) { - const submittingToast = toast.info('submitting asset', { - className: styles.info - }) + const submittingToast = toast.info('submitting asset') console.log(values) const metadata = transformPublishFormToMetadata(values) @@ -112,7 +111,7 @@ export default function PublishForm({ {({ isSubmitting, isValid, status, setStatus }) => ( status === 'empty' && setStatus(null)} + // onChange={() => status === 'empty' && setStatus(null)} > {content.data.map((field: FormFieldProps) => (