saima_final.zip

External Libraries

Chakra UI: https://chakra-ui.com/docs/components/concepts/overview

Chakra UI is a simple, modular and accessible component library that provides you with the building blocks you need for your React applications

Chakra groups its different components by categories, like layout, forms, data display, feedback, typography or overlay

Layout

in charge of setting virtual delimiters or boundaries for your content. They also manage how their children are laid (row or column) and the spacing between them among other properties. Some layout components to highlight are:

Typography

There are two main components from this group:

Style props

Chakra uses style props to provide css directives directly as props to the different components. You can find a reference of all the available style props in the Chakra UI documentation.

As a general rule, you can consider camelCase versions of css styles to be valid style props. But you can also leverage the shorthand version. For example, instead of using backgroundColor, you can use bg.

<Box backgroundColor='tomato' /> is equivalent to <Box bg='tomato' />

the below example represents three boxes stacked in a row, with a vertical space of 16px between boxes, where each box has a height of 40px and a different background color, as well as a particular number as its children:

<HStack spacing=”16px”>
  <Box h='40px' bg='yellow.200'>
    1
  </Box>
  <Box h='40px' bg='tomato'>
    2
  </Box>
  <Box h='40px' bg='pink.100'>
    3
  </Box>
</HStack>

Formik and Yup: https://formik.org/docs/api/useFormik & https://www.wisp.blog/blog/yup-validation-for-react-forms-a-complete-guide

Formik → popular open-source library that helps you to create forms in React.

useFormik hook → handles all the different states of form

Yup → JavaScript open-source library used to validate the form data before submitting it to the server.

import * as Yup from 'yup';
import { useFormik } from 'formik';

// The below code would go inside a React component
const {
  values,
  errors,
  touched,
getFieldProps,
handleSubmit,
} = useFormik({
intialValues: {
    comment: "",
  },
onSubmit: (values) => {
    // Handle form submission
  },
validationSchema: Yup.object({
    comment: Yup.string().required("Required"),
  }),
});