Open kamescg opened 4 years ago
The frontend auto-generates forms using a JSON file
OK, I think I follow. So basically this JSON file that needs to match against the Lambda's params .
When you say "the frontend auto-generates", who's doing the generating?
Does the thing doing the generating target react-form-hook
?
Correct. The JSON file is the meta description for the included fields the how the form will look.
Then in the foundry
we generate those forms.
https://github.com/rapid-eth/rapid-adventures/blob/dev/apps/dapp/src/foundry/Forms/index.js
using the Form Generate module.
https://github.com/rapid-eth/rapid-adventures/tree/dev/packages/form-generate
The metadata is converted into a react-hook-form
component.
I still have to add some custom submit and validation handlers in the foundry part, but for the most part we should be able to just describe our forms and React will build them for us.
The
QuestCreateForm
needs to include fields required by the backend service verifying quest completion.https://github.com/rapid-eth/rapid-lambdas
@onpaws The frontend auto-generates forms using a JSON file with barebones versioning (no more writing components and we allow third-parties to easily define forms in the future) so we should add fields and also bump the version to 0.0.2
https://github.com/rapid-eth/rapid-adventures/blob/dev/apps/dapp/src/schema/Quest/index.js