Skip to content

Commit

Permalink
fix non-submit bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanlesich committed Oct 4, 2023
1 parent 84dd5ff commit 38f7ab4
Showing 1 changed file with 74 additions and 65 deletions.
139 changes: 74 additions & 65 deletions apps/web/src/modules/create-dao/components/Artwork/ArtworkForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const Artwork: React.FC<ArtworkProps> = ({ title }) => {
setActiveSection,
ipfsUpload,
isUploadingToIPFS,
setSetUpArtwork,
} = useFormStore()

const initialValues = {
Expand Down Expand Up @@ -49,73 +50,81 @@ export const Artwork: React.FC<ArtworkProps> = ({ title }) => {
validationSchema={validationSchemaArtwork}
onSubmit={handleSubmit}
>
{(formik) => (
<Form>
<TextArea
{...formik.getFieldProps('projectDescription')}
inputLabel={'Collection Description'}
formik={formik}
id={'projectDescription'}
onChange={formik.handleChange}
onBlur={formik.handleBlur}
errorMessage={
formik.touched?.projectDescription && formik.errors?.projectDescription
? formik.errors?.projectDescription
: undefined
}
placeholder={'Nouns is an experiment which combines...'}
/>

<ArtworkUpload
{...formik.getFieldProps('artwork')}
inputLabel={'Artwork'}
formik={formik}
id={'artwork'}
onChange={formik.handleChange}
onBlur={formik.handleBlur}
helperText={
'Builder uses folder hierarchy to organize your assets. Upload a single folder containing a subfolder for each trait. Each subfolder should contain every variant for that trait.'
}
errorMessage={
formik.touched.artwork && formik.errors?.artwork
? formik.errors?.artwork
: undefined
}
/>
{(formik) => {
return (
<Form>
<TextArea
{...formik.getFieldProps('projectDescription')}
inputLabel={'Collection Description'}
formik={formik}
id={'projectDescription'}
onChange={(e) => {
formik.handleChange(e)
setSetUpArtwork({
...setUpArtwork,
projectDescription: (e.target as HTMLInputElement).value,
})
}}
onBlur={formik.handleBlur}
errorMessage={
formik.touched?.projectDescription && formik.errors?.projectDescription
? formik.errors?.projectDescription
: undefined
}
placeholder={'Nouns is an experiment which combines...'}
/>

<Flex justify={'space-between'} mt={'x8'}>
<Button
justify={'center'}
align={'center'}
borderRadius={'curved'}
h={'x15'}
minH={'x15'}
minW={'x15'}
variant={'secondary'}
onClick={handlePrevious}
aria-label="Back"
>
<Icon id="arrowLeft" />
</Button>
<Button
flex={1}
borderRadius={'curved'}
width={'auto'}
ml={'x2'}
minH={'x15'}
type="submit"
disabled={
!isEmpty(formik.errors) ||
formik.isSubmitting ||
isUploadingToIPFS ||
ipfsUpload.length === 0
<ArtworkUpload
{...formik.getFieldProps('artwork')}
inputLabel={'Artwork'}
formik={formik}
id={'artwork'}
onChange={formik.handleChange}
onBlur={formik.handleBlur}
helperText={
'Builder uses folder hierarchy to organize your assets. Upload a single folder containing a subfolder for each trait. Each subfolder should contain every variant for that trait.'
}
>
Continue
</Button>
</Flex>
</Form>
)}
errorMessage={
formik.touched.artwork && formik.errors?.artwork
? formik.errors?.artwork
: undefined
}
/>

<Flex justify={'space-between'} mt={'x8'}>
<Button
justify={'center'}
align={'center'}
borderRadius={'curved'}
h={'x15'}
minH={'x15'}
minW={'x15'}
variant={'secondary'}
onClick={handlePrevious}
aria-label="Back"
>
<Icon id="arrowLeft" />
</Button>
<Button
flex={1}
borderRadius={'curved'}
width={'auto'}
ml={'x2'}
minH={'x15'}
type="submit"
disabled={
!isEmpty(formik.errors) ||
formik.isSubmitting ||
isUploadingToIPFS ||
ipfsUpload.length === 0
}
>
Continue
</Button>
</Flex>
</Form>
)
}}
</Formik>
)
}

0 comments on commit 38f7ab4

Please sign in to comment.