Open omnisci3nce opened 1 year ago
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
UI
Form
Follow the patterns in
components/LoginForm
form
variable withuseForm
passing in PreferencesFormFields for the type parameter, and set default initial values.{...form.getInputProps('username', { withError: false })}
to connect each input field up to the form hook (replace with correct property name instead of 'username')<form></form>
element and set theonSubmit
property of theform
element to justconsole.log
the values