Giter Club home page Giter Club logo

react-test's Introduction

React test

alt

You have been given the task of making a TODO list page. A table should show which items belong to which person and whether or not they have been completed. To avoid having a huge table, it must be accompanied by a paging system. Last but not least, we want to add items to the list. Adding items to the list is a local operation, which means that no POST request is made to add the item, it just needs to be added to the table. You have one hour to complete as many of the following requirments as possible. But first, don't forget to read the rules bellow. Use this codesandbox as a starting point: https://codesandbox.io/s/new

Rules

  • Surfing the web is allowed!
  • You can use any layout system if you want. (Ant Design, Material UI, Bootstrap, etc...)
  • You can use both functional and class components.
  • No code optimization required.
  • There is no mandatory code style, feel free to use any style you want as long as it is easy to read.

Requirements

Data

Data should be fetched from this dummy endpoint https://jsonplaceholder.typicode.com/todos. You can use fetch, axios or any other method for fetching the information. This endpoint contains dummy data about a TODO list with this format:

{
	userId: 1, //User id
	id: 1, // TODO id
	title: "delectus aut autem", // TODO description
	completed: false // Wether the TODO has been completed or not
},

Table

The table must contain four columns in this particular order: alt

  • #: id field from schema above. Centered.
  • User: userId field from schema above. Centered.
  • Description: title field from schema above.
  • Completed: completed field from schema above. Centered. If true, a check icon should be put in place, otherwise, a cross icon.

Make sure to add borders to the cells to add clarity to your table. Table rows of uncompleted elements should have another background color.

Pagination:

alt
Must be dinamic according to the size of the table with 10 elements per page. The selected page must be shown in bold text as shown above. When clickin on each number the page, and so, the content of the table should change.

New todo

An input will help the user add elements to the table as such: alt

As you can see bellow, when an item is added to the list it must appear at the top of the table. Add a random userId and id. By default the element will be uncompleted. Once the form has been submitted the cursor should automatically focus the input again. You can trigger the form submission by clickin on the Button at the right or by pressing the Enter key in your keyboard.

Loading

alt

A loading screen should appear while the data is being fetched. Don't forget to add a Reload button.

Error

alt

A error screen should appear if there was an issue loading the data. (You can use Offline mode in Chrome developper console to try this one out)

react-test's People

Contributors

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