tYuriy / react_goods-selector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Goods Selector

React + Typescript cheat sheet

You are given an array of goods. Render them in a table with the ability to select one or clear selection.

Here is the working version

  1. Write everything inside the App (don't create additional components).
  2. Save a selectedGood in the state (Jam is the default value).
  3. Show the name of the selected good in the h1.title (Jam is selected).
  4. Add the has-background-success-light class to the tr of the selected Good.
  5. Show the ClearButton button in the title only when a good is selected.
  6. ClearButton should clear selection by setting an empty string to selectedGood.
  7. When there is no selected good, the title should show No goods selected.
  8. Each good should have an AddButton to select the good.
    • only 1 good can be selected at a time;
  9. Don't show AddButton when a good is selected.
  10. Show RemoveButton for the selected good to clear selection.

Instructions

About

License:GNU General Public License v3.0


Languages

Language:JavaScript 69.9%Language:TypeScript 26.0%Language:HTML 3.4%Language:SCSS 0.4%Language:Shell 0.4%