- Node.js 16 or higher
- Yarn package manager
- Install dependencies
yarn install
- Start dev server
yarn start
- Open
http://localhost:3000
in a browser
app/
public/
favicon.ico
src/
assets/
images/
components/
atoms/
molecules/
organisms/
templates/
core/
constants/
types/
hooks/
hocs/
helpers/
pages/
styles/
utils/
organisms/
Modal/
hooks/
useModal.ts
useModal.utils.ts
Modal.tsx
Modal.test.tsx
Modal.styles.ts
Modal.types.ts
Modal.utils.ts
import React from 'react';
import Auth from 'aws-cognito';
... // internal libraries
import { ... } from '@constants';
import { useValidation } from '@hooks';
... // global helpers
import { ... } from '@atoms';
import { ... } from '@molecules';
import { ... } from '@mui/material';
... // components
import { ... } from './Form.styles';
import { ... } from './Form.utils';
import { FormDataType } from './Form.types';
import { useForm } from './hooks/useForm';
... // component helpers
interface Props extends HTMLAttributes<HTMLFormElement> {
...
};
export const Form: React.FC<Props> = ({ onSubmit, ...attributes }) => {
const [formData, onChange, handleOnSubmit] = useForm(onSubmit);
if (!formData) {
return null;
}
return (
<form { ...attributes } onChange={onChange}>
...
<form>
);
};