Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Son Nguyen - Front-end challenge #40

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Sonn1
Copy link

@Sonn1 Sonn1 commented May 8, 2023

Implementation detail

State management

To share the state between the different components during the sign-up flow, I'm using a reducer (/reducer/signUpReducer.js) to manage the state logic outside of the components.

The state managed by this reducer will be put in the Context so each child component of the Context provider will easily get access to the state.

In other words, I'm combining the reducer and context together so every component in the tree can simply call the dispatch function from the reducer to update the state. Please check the App.js to see the tree structure.

Routing

I'm using react-router v6 to easily manage the routing between the different pages in the sign-up flow.

Form

I'm using formik v2 to easily manage the state and error handling in the sign-up forms. Also, I can add a schema validation file (/schema/index.js) for the input validations.

Components structure

I follow the atomic design. Thus, I keep atomic components in the atoms folder and components that reuse atomic
components in the components folder.

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

Successfully merging this pull request may close these issues.

1 participant