Coder Social home page Coder Social logo

react_add-todo-form's Introduction

React Add TODO Form

Implement the ability to add TODOs to the TodoList implemented in the Static List of TODOs

Here is the working example

  1. Create an App component storing the todos array and displaying it using the TodoList.
  2. Create a form to add new TODOs:
    • there should be a text input for the title with data-cy="titleInput" attribute;
    • add a <select> with data-cy="userSelect" attribute showing all the given users;
    • add labels and placeholders where they are needed;
    • add a new todo to the list after clicking the Add button;
    • each TODO should have id, title, userId, and completed (false by default);
    • id is the largest id in the array + 1 (add data-id={todo.id} attribute to each .TodoInfo).
  3. Add validation to the form:
    • add a default empty option Choose a user to the select;
    • before creating a todo, check if a user was selected; if not, show an error message next to the select (Please choose a user);
    • if the title is empty, show an error message next to the title field (Please enter a title);
    • errors should appear only after clicking the Add button;
    • hide the message immediately after any change of the field with an error;
  4. If the form is valid, add a todo to the list and clear the form.
  5. (* Optional) Allow entering only letters (ua and en), digits, and spaces in the title field. Just remove any other characters from the title.

Instructions

  • Install Prettier Extention and use this VSCode settings to enable format on save.
  • Implement a solution following the React task guideline.
  • Use the React TypeScript cheat sheet.
  • Open one more terminal and run tests with npm test to ensure your solution is correct.
  • Replace <your_account> with your Github username in the DEMO LINK and add it to the PR description.

react_add-todo-form's People

Contributors

alenatovstukha avatar danheim avatar irenhh avatar mgrinko avatar mhrynko avatar murat-yesimbietov avatar mykhalenych avatar solaryasha avatar vpolets avatar yuriiholiuk avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.