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

feat(feed): include network icon in tx feed items #5148

Merged
merged 5 commits into from
Mar 25, 2024
Merged

Conversation

satish-ravi
Copy link
Contributor

@satish-ravi satish-ravi commented Mar 25, 2024

Description

Made a reusable component to create an icon with a badge and used for all icons in the tx feed

Test plan

Manually

Pending, send/receive Nfts and swaps

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

emerge-tools bot commented Mar 25, 2024

1 build increased size

Name Version Download Change Install Change Approval
Celo (test)
org.celo.mobile.test
1.81.0 (146) 24.2 MB ⬆️ 2.7 kB (0.01%) 60.4 MB ⬆️ 4.1 kB N/A

Celo (test) 1.81.0 (146)
org.celo.mobile.test

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

Total install size change: ⬆️ 4.1 kB
Total download size change: ⬆️ 2.7 kB (0.01%)

Largest size changes

Item Install Size Change
🗑 celo ⬇️ -15.5 MB
📝 valora ⬆️ 1.6 MB
📝 Lottie ⬆️ 782.7 kB
📝 Code Signature ⬆️ 662.6 kB
📝 Strings.CFStrings ⬆️ 650.6 kB
View Treemap

Image of diff


🛸 Powered by Emerge Tools

github-merge-queue bot pushed a commit that referenced this pull request Mar 25, 2024
)

### Description

Accepting network ids as an array would mean that the selector
recomputes the result even if the same list of network ids are passed
and returns a new result, resulting in unnecessary rerenders. This
updates it so that the selector returns all network id's icons. An
alternative approach would be to set `memoizeOptions` like
`tokenIdsSelector`, but there doesn't seem to be any harm in returning
all network's icon in the function. The consumer of this selector can
pick the required networks' icon from the object

### Test plan

CI, ensured the below warning doesn't show in #5148 when merged with
this change
<img
src="https://github.com/valora-inc/wallet/assets/5062591/14ac3745-d92c-44a7-9a1a-4c93837eff2e"
width="200"/>


### Related issues

N/A

### Backwards compatibility

Yes

### 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)
@satish-ravi satish-ravi marked this pull request as ready for review March 25, 2024 19:48
Copy link

codecov bot commented Mar 25, 2024

Codecov Report

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

Project coverage is 85.70%. Comparing base (8de58fa) to head (558d7c3).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #5148   +/-   ##
=======================================
  Coverage   85.70%   85.70%           
=======================================
  Files         730      731    +1     
  Lines       29861    29877   +16     
  Branches     5156     5158    +2     
=======================================
+ Hits        25592    25607   +15     
- Misses       4034     4035    +1     
  Partials      235      235           
Files Coverage Δ
src/transactions/feed/SwapFeedItem.tsx 93.75% <ø> (ø)
src/transactions/feed/TokenApprovalFeedItem.tsx 100.00% <ø> (ø)
src/transactions/feed/TransactionFeedItemImage.tsx 93.75% <100.00%> (+0.64%) ⬆️
src/transactions/feed/TransferFeedItem.tsx 94.44% <ø> (ø)
src/components/IconWithNetworkBadge.tsx 91.66% <91.66%> (ø)
src/transactions/feed/NftFeedItem.tsx 88.57% <50.00%> (+0.33%) ⬆️

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 8de58fa...558d7c3. Read the comment docs.

Copy link
Collaborator

@MuckT MuckT left a comment

Choose a reason for hiding this comment

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

🎨 Looks great to me - tested on iOS and Android.

@satish-ravi satish-ravi added this pull request to the merge queue Mar 25, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 25, 2024
@satish-ravi satish-ravi added this pull request to the merge queue Mar 25, 2024
Merged via the queue into main with commit ea2e5fc Mar 25, 2024
16 checks passed
@satish-ravi satish-ravi deleted the satish/act-1085 branch March 25, 2024 23:00
shottah pushed a commit to zed-io/kolektivo that referenced this pull request May 15, 2024
…lora-inc#5147)

### Description

Accepting network ids as an array would mean that the selector
recomputes the result even if the same list of network ids are passed
and returns a new result, resulting in unnecessary rerenders. This
updates it so that the selector returns all network id's icons. An
alternative approach would be to set `memoizeOptions` like
`tokenIdsSelector`, but there doesn't seem to be any harm in returning
all network's icon in the function. The consumer of this selector can
pick the required networks' icon from the object

### Test plan

CI, ensured the below warning doesn't show in valora-inc#5148 when merged with
this change
<img
src="https://github.com/valora-inc/wallet/assets/5062591/14ac3745-d92c-44a7-9a1a-4c93837eff2e"
width="200"/>


### Related issues

N/A

### Backwards compatibility

Yes

### 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)
shottah pushed a commit to zed-io/kolektivo that referenced this pull request May 15, 2024
### Description

Made a reusable component to create an icon with a badge and used for
all icons in the tx feed

### Test plan

Manually

| Pending, send/receive | Nfts and swaps |
|:--------:|:--------:|
| <img
src="https://github.com/valora-inc/wallet/assets/5062591/756a7902-3169-4371-875c-51dad8659425"
width="250" /> | <img
src="https://github.com/valora-inc/wallet/assets/5062591/5a5c1aae-9b9e-48bb-8fee-8be64843d941"
width="250" /> |



### Related issues

- Fixes ACT-105

### Backwards compatibility

Yes

### 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)
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.

2 participants