Giter VIP home page Giter VIP logo

multistep's Introduction

Multi Step Form

It's a simple step-by-step form using React/Context Api. Created to solve this challenge. Build a GUI that at least: -Show one page of the form at a time.

  • Show the current page position of the form.
  • Validate the input fields upon submission of each page.
  • If there are any validation errors, show an error message in the form and block progress.
  • Console.logs the resultant data on the final page.

The project

The structure

|- src/
   |- components
   |- containers
   |- context
   |- hooks

Presentational components

First of all I created the components module containing all presentational components and within the folder a subfolder with the test for the components

|- components
    | - __tests__
        | -Steps.test.tsx
    |- Steps
        |- index.js

Context

The content folder was created to combine the context, provider and consumers..

|- context
    | - FormContext.tsx
    |- index

Layout

To help me to build web the interface I used several components from react-semantic-ui.

Technologies I use

This project was bootstrapped with Create React App.

  • JavaScript - ES6+ (Babel);
  • UI Components - React, react-semantic-ui;
  • State management - React Context that provides a way to share values between components without having to explicitly pass a prop through every level of the tree.;
  • Unit tests: Jest, Enzyme, React, testing libry;
  • Clean code - Typescript, Strong types make your code more reliable when you work in larger and good opportunity to continue learning.;

Getting started

I encourage you to use the yarn to install the packages, you'll enjoy the yarn.lock to a faster installation, and the scripts will be fast too.

Install

##Prerequisites

You will need too install the dependecies

You’ll need to have Node >= 8.10 on your local development machine and I am going to use yarn in my examples but you can use npm to install the various modules needed during the setup. If you don’t have yarn, you can see the installation instructions here.

  $ yarn  start

Start app

  $ yarn or npm start

This will runs the app in the development mode. Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

Running tests

  yarn test

When you run yarn test, Jest will launch in watch mode*. Every time you save a file, it will re-run the tests.

Production build

  yarn build

Builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.

multistep's People

Watchers

Carol avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.