Skip to content

Conversation

@gdcho
Copy link

@gdcho gdcho commented Jan 30, 2024

Stopwatch Functionality πŸ§‘β€πŸ”§:

  • The stopwatch should start counting when the user clicks the start button.
  • The stopwatch should stop counting when the user clicks the stop button.
  • The stopwatch should reset to zero when the user clicks the reset button.
  • The stopwatch should record and display laps when user clicks the lap button.

Test πŸ§ͺ:
image

File Structure πŸ—‚οΈ:

β”œβ”€β”€ README.md
β”œβ”€β”€ babel.config.js
β”œβ”€β”€ dist
β”‚Β Β  β”œβ”€β”€ app.bundle.js
β”‚Β Β  β”œβ”€β”€ app.bundle.js.LICENSE.txt
β”‚Β Β  └── index.html
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ package.json
β”œβ”€β”€ postcss.config.js
β”œβ”€β”€ public
β”‚Β Β  └── index.html
β”œβ”€β”€ src
β”‚Β Β  β”œβ”€β”€ App.tsx
β”‚Β Β  β”œβ”€β”€ StopWatch.tsx
β”‚Β Β  β”œβ”€β”€ StopWatchButton.tsx
β”‚Β Β  β”œβ”€β”€ __tests__
β”‚Β Β  β”œβ”€β”€ index.tsx
β”‚Β Β  └── styles
β”œβ”€β”€ tailwind.config.js
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ webpack.common.js
β”œβ”€β”€ webpack.dev.js
└── webpack.prod.js

Components πŸ’Ώ:

  • src/App.tsx - Sets up and manages the shared component state across the application, also responsible for the primary logic of the stopwatch.
  • src/Stopwatch.tsx - Manages the display of elapsed time, buttons, and lap records, as well as the logic associated with these buttons.
  • src/StopwatchButton.tsx - Responsible for the presentation and visibility of buttons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant