Closed ashayp22 closed 2 years ago
Are the validate()
function and FormControl
components in Apply.js
necessary (and corresponding components I'd add to CreateUnit
, etc.)? It seems sufficient to just disable the submit button by creating the areAllFilled
bool and passing it to the Drawer
component in CreateUnit.js
, like this:
const areAllFilled = name !== '' && purpose !== ''
return (
<Drawer
titleText="Add Custom Unit"
successText="Create Unit"
successCallback={success}
closeCallback={close}
isDisabled={!areAllFilled}
body={body}
/>
)
The same can be done for lesson and vocab item.
Describe the bug We should validate the forms on the
Create Unit
,Create Lesson
, andAdd Vocab Item
modals. We can do this by:Check out
client/src/pages/Apply
for examples on how to do the form validation.