Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnimatedNumber component with hook wrapping animateValue #509

Merged
merged 6 commits into from
Oct 27, 2022

Conversation

juandjara
Copy link
Contributor

Description

This is a follow up of the changes proposed in RFC #479 and the discussion originated from PR #504. This PR extracts the new animation component used in comparative widgets that wraps around the animateValue function in utils folder.

The changes included in this PR are the following:

  • implement useAnimatedNumber hook based on animateValue util, encapsulating state, refs and effects
  • implement <AnimatedNumber /> component as a simple interface to render the results of useAnimatedNumber hook.
  • provide JSDoc documentation for both AnimatedNumber and useAnimatedNumber
  • provide TS typings for both AnimatedNumber and useAnimatedNumber

Type of change

(choose one and remove the others)

  • Feature

Acceptance

As with other comparative widget PRs, you can use this branch of carto-react-template to test the behaviour of ComparativeFormulaWidgetUI and ComparativeCategoryWidgetUI. Both widgets have been uptaded with the changes necesary in their respective branches.

Basic checklist

  • Good PR name
  • Shortcut link
  • Changelog entry
  • Just one issue per PR
  • GitHub labels
  • Proper status & reviewers
  • Tests
  • Documentation

- encapsulate animation effects in widgets
- wrap around `animateValue` in utils
- provide JSDoc documentation
- provide TS typings
@juandjara juandjara changed the title add AnimatedNumber component AnimatedNumber component with hook wrapping animateValue Oct 26, 2022
@coveralls
Copy link
Collaborator

coveralls commented Oct 26, 2022

Pull Request Test Coverage Report for Build 3339056222

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 71.74%

Totals Coverage Status
Change from base Build 3336891990: 0.0%
Covered Lines: 1703
Relevant Lines: 2219

💛 - Coveralls

@VictorVelarde
Copy link
Contributor

Would you please also add a little line to changelog?

@juandjara
Copy link
Contributor Author

@VictorVelarde all requested changes are ready. Thanks for your quick feedback

Copy link
Contributor

@VictorVelarde VictorVelarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@VictorVelarde VictorVelarde merged commit 245612c into master Oct 27, 2022
@VictorVelarde VictorVelarde deleted the feature/use-animated-number branch October 27, 2022 16:20
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.

3 participants