Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Configure Preferences card should have a Save button that can submit the form #8

Open
omnisci3nce opened this issue Jan 4, 2023 · 1 comment
Assignees
Labels

Comments

@omnisci3nce
Copy link
Owner

UI

  • "Save" button in bottom right of card
  • default colour

image

Form

Follow the patterns in components/LoginForm

  • create a form variable with useForm passing in PreferencesFormFields for the type parameter, and set default initial values.
  • use {...form.getInputProps('username', { withError: false })} to connect each input field up to the form hook (replace with correct property name instead of 'username')
  • wrap the form fields in a <form></form> element and set the onSubmit property of the form element to just console.log the values
@omnisci3nce omnisci3nce self-assigned this Jan 5, 2023
@omnisci3nce
Copy link
Owner Author

Update from Discord:

ok I worked on the Preferences card a bit. I've figured out how to combine React Query with the useForm from mantine
just for that specific form
it's a little overkill otherwise I think but in this case after you click "Save" we want to refetch the data and then always have the form open instead of how you'd traditionally submit the form then close the form or modal, or navigate away
which we can do with the invalidate of React Query
So, that's nice. Took a while but we got there

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant