GithubHelp home page GithubHelp logo

sleep-calculator's People

Contributors

jeevadeepan avatar

Watchers

 avatar  avatar

sleep-calculator's Issues

Implement DurationSelect component

Implement a reusable DurationSelect component that displays a dropdown of time duration (0 - 24 hours) in 30 min increments.

Doc reference - https://reactjs.org/docs/forms.html#the-select-tag

Acceptance criteria:-

  • Needs to take in a render a dynamic label
  • Accepts an 'onChange' callback to be invoked when dropdown value changes
  • Selects passed 'value' from the list
  • Should be accessible
  • Should be unit tested

Implement SleepScore Component

Implement SleepScore Component that lets a user select their duration in bed and the time they were asleep and provides a sleep score.

Acceptance criteria:-

  • User should be able to select their duration in bed and duration asleep
  • User should be able to see their sleep score when they hit 'Calculate' button
  • 'Calculate' button should be enabled only after duration inputs are selected and valid
  • User should see a graceful error message when score calculation fails
  • Page elements should be accessible
  • Component should be unit tested

Integrate - /save API

Integrate /save API with SleepScore component to store user's sleep score when it's calculated.

Acceptance criteria:-

  • Create a mock /save endpoint that accepts a POST request and returns a random 200 or 5xx
  • Sleep score should be sent to /save endpoint whenever it's calculated
  • Successful response should display calculated score in output
  • Failed request should be gracefully handled to display an error message

Update readme

Update .README file with

  • steps to install the project dependencies
  • steps to run
  • instructions to run tests

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.