diff --git a/src/DistBuilder.re b/src/DistBuilder.re new file mode 100644 index 00000000..eccc3cce --- /dev/null +++ b/src/DistBuilder.re @@ -0,0 +1,63 @@ +open BsReform; + +module FormConfig = [%lenses + type state = { + name: string, + description: string, + picture: string, + } +]; + +module Form = ReForm.Make(FormConfig); + +let schema = Form.Validation.Schema([||]); + +module FieldString = { + [@react.component] + let make = (~field, ~label) => { + + E.ste}> + validate()} + /> + + } + />; + }; +}; + +[@react.component] +let make = () => { + let reform = + Form.use( + ~validationStrategy=OnDemand, + ~schema, + ~onSubmit=({state}) => {None}, + ~initialState={name: "", description: "", picture: ""}, + (), + ); + + let onSubmit = e => { + e->ReactEvent.Synthetic.preventDefault; + reform.submit(); + }; + + + + + + + + {reform.state.formState == Submitting + ? "Loading" |> E.ste + : + {"Submit" |> E.ste} + } + + + ; +};