wallet icon indicating copy to clipboard operation
wallet copied to clipboard

feat(points): add number ticker for balance

Open kathaypacific opened this issue 10 months ago • 1 comments

Description

As the title. The approach was largely inspired by a nice man on youtube.

I've added support for decimals in case we want to use this for the wallet balance.

The ticker animation will run any time the value changes, so it will work automatically for when the points balance changes and the user remains on the screen.

The downside with animations is that there's a lot of smoke and mirrors that mess with the dom. For this ticker, we're basically animating columns of text up and down. From the dom it no longer looks like the actual balance and we lose the ability to assert on its value from the unit tests.

Test plan

Without decimals:

https://github.com/valora-inc/wallet/assets/20150449/a9ce407e-544e-4a69-85c1-9219f629360b

With decimals:

https://github.com/valora-inc/wallet/assets/20150449/4128f00a-0949-4321-98ba-8dda0cd23c89

Related issues

  • Fixes RET-1072

Backwards compatibility

Y

Network scalability

If a new NetworkId and/or Network are added in the future, the changes in this PR will:

  • [x] Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)

kathaypacific avatar Apr 26 '24 13:04 kathaypacific

Codecov Report

Attention: Patch coverage is 97.05882% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 85.91%. Comparing base (31acd51) to head (e8af89c). Report is 17 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5345      +/-   ##
==========================================
+ Coverage   85.86%   85.91%   +0.04%     
==========================================
  Files         737      738       +1     
  Lines       30162    30173      +11     
  Branches     5171     5168       -3     
==========================================
+ Hits        25899    25923      +24     
+ Misses       4030     4018      -12     
+ Partials      233      232       -1     
Files Coverage Δ
src/points/PointsHome.tsx 100.00% <100.00%> (ø)
src/components/NumberTicker.tsx 96.87% <96.87%> (ø)

... and 16 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 31acd51...e8af89c. Read the comment docs.

codecov[bot] avatar Apr 26 '24 13:04 codecov[bot]

1 build decreased size

Name Version Download Change Install Change Approval
Celo (test)
org.celo.mobile.test
1.83.0 (148) 27.6 MB ⬇️ 152.8 kB (-0.55%) 65.6 MB ⬇️ 327.6 kB (-0.5%) N/A

Celo (test) 1.83.0 (148)
org.celo.mobile.test

⚖️ Compare build 📦 Install build ⏱️ Analyze build performance

Total install size change: ⬇️ 327.6 kB (-0.5%) Total download size change: ⬇️ 152.8 kB (-0.55%)

Largest size changes

Item Install Size Change
🗑 react_native_video ⬇️ -173.2 kB
🗑 Promises ⬇️ -31.1 kB
Code Signature ⬇️ -15.8 kB
main.jsbundle ⬆️ 12.3 kB
🗑 RCTVideoManager ⬇️ -11.0 kB
View Treemap

Image of diff


:flying_saucer: Powered by Emerge Tools

emerge-tools[bot] avatar Apr 29 '24 11:04 emerge-tools[bot]