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

chore(discover): Update rewards icon #6237

Merged
merged 9 commits into from
Nov 22, 2024
Merged

chore(discover): Update rewards icon #6237

merged 9 commits into from
Nov 22, 2024

Conversation

finnian0826
Copy link
Contributor

@finnian0826 finnian0826 commented Nov 15, 2024

Description

Add new icon and use in the rewards card

Test plan

Related issues

Backwards compatibility

Yes

Network scalability

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

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

Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.93%. Comparing base (5853f2f) to head (cea61f1).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6237      +/-   ##
==========================================
- Coverage   88.93%   88.93%   -0.01%     
==========================================
  Files         737      737              
  Lines       31433    31432       -1     
  Branches     5835     5839       +4     
==========================================
- Hits        27954    27953       -1     
  Misses       3279     3279              
  Partials      200      200              
Files with missing lines Coverage Δ
src/dappsExplorer/DappFeaturedActions.tsx 100.00% <100.00%> (ø)
src/icons/Reward.tsx 100.00% <100.00%> (ø)

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 5853f2f...cea61f1. Read the comment docs.

---- 🚨 Try these New Features:

@finnian0826 finnian0826 marked this pull request as ready for review November 15, 2024 23:02
Copy link
Contributor

@jophish jophish left a comment

Choose a reason for hiding this comment

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

Looking closely at the image of your emulator, it seems like the bottom and right-hand side of the image is cropped (ever so slightly) compared to the designs

@finnian0826
Copy link
Contributor Author

finnian0826 commented Nov 18, 2024

Looking closely at the image of your emulator, it seems like the bottom and right-hand side of the image is cropped (ever so slightly) compared to the designs

@jophish ahh I was using the size from figma but the size in the converted svg was slightly different. Just updated and updated the image in the test plan and looks good now.

import Svg, { Path } from 'react-native-svg'

const Reward = ({ size = 34 }: { size?: number } = {}) => (
<Svg width={size} height={size} fill="none">
Copy link
Contributor

Choose a reason for hiding this comment

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

does this need a viewbox too if you want to allow customizing size? Also I notice we use pngs for other similar icons. Is there a reason to use svg for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added viewbox in e06a6a7, the reason I did an svg component instead of a png is that the image it was replacing was an svg component. I can change to a png instead if that is preferred though.

import Svg, { Path } from 'react-native-svg'

const Reward = ({ size = 34 }: { size?: number } = {}) => (
<Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`} fill="none">
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't believe this will work correctly if you specify different size params. Here's some useful info on how viewbox / width / height work https://valora-app.slack.com/archives/C025V1D6F3J/p1724705958982739

@finnian0826 finnian0826 added this pull request to the merge queue Nov 22, 2024
Merged via the queue into main with commit 45363d2 Nov 22, 2024
15 checks passed
@finnian0826 finnian0826 deleted the finnian0826/act-1465 branch November 22, 2024 23:11
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