Giter Club home page Giter Club logo

acl2-16-color-picker's Introduction

Color Picker

Demo

https://alchemy-react-color-picker.netlify.app/

Getting Started

Use this template to get started.

Learning Objectives

  • Use custom hooks to bundle together multiple useState & useEffect calls

Description

Our app is a simple one: a colorful message generator. It has a form where you select a foreground color, a background color, and write some text. It will take what you chose and display it in a lovely little box below the form. Cool! ๐Ÿ˜Ž

Because we want to delight our end users and send out good vibes, it also displays an affirmation message at the top of the form whenever a new foreground or background color is picked. When text is written, it resets the affirmation message back to the normal form instructions.

In our ColorPicker view, we have quite a few useState calls and a useEffect that we want to refactor out into custom hooks: useColorPicker and useAffirmation. Your job is to create these custom hooks by extracting the relevant useState and useEffect calls into their corresponding custom hooks.

Anything related to the form values or handling form changes for the color picker should go in the useColorPicker hook.

Anything related to setting or changing affirmations should go into the useAffirmation hook.

Acceptance Criteria

  • useColorPicker hook implemented
  • useAffirmation hook implemented
  • Existing tests pass
  • STRETCH: Combine the multiple useState calls for the color picker form into one
  • STRETCH: Write tests for your custom hooks (see this post for an example)

Rubric

Task Points
useColorPicker complete 5
useAffirmation complete 5

acl2-16-color-picker's People

Contributors

dylan-floyd avatar

Watchers

 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.