/tara-petric-fatcat-task

Primary LanguageTypeScriptMIT LicenseMIT

Quick start

To run the project run npm run dev in the main directory.

It will lead you to the main page that was generated by using the PageGenerator component. It showcases some already existing components as well as the newly created User List and Form Generator Component

Page Generator Component

It is a simple generator component that generates layoutSections as well the containing components. The class-names that are passed via the className prop are applied to each section. The props that are defined in the spec are passed to the component that the key string mapped to.

Form Generator Component

The CreateForm generates form components, The component that uses this component to generate forms should provide (among other things, already specified):

  • custom mutation hook, that returns react-query's useMutation with a specified custom post function
  • zod schema
  • custom field type, specifying the fields, ensuring generic type safety.

Fetch Users Component

A straightforward component that utilizes react quiery for managing the fetching and up-to-dateness of the user list data.