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(earn-info): keep token icon and name on the same line #6222

Merged
merged 5 commits into from
Nov 13, 2024
Merged

Conversation

MuckT
Copy link
Collaborator

@MuckT MuckT commented Nov 12, 2024

Description

Slight layout adjustment to keep the token icon and name on the same line.

iOS Android

Test plan

  • Tested locally on iOS
  • Tested locally on Android

Related issues

Backwards compatibility

Yes

Network scalability

N/A

@@ -212,7 +216,6 @@ export default function EarnPoolInfoScreen({ route, navigation }: Props) {
}, [allPositionsWithBalance])

const onPressWithdraw = () => {
// TODO(tomm): once act-1385 is merge use the bottom sheet button presses
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is covered by the event EarnEvents.earn_select_withdraw_type.

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.97%. Comparing base (c9bc051) to head (981d640).
Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6222      +/-   ##
==========================================
- Coverage   88.97%   88.97%   -0.01%     
==========================================
  Files         736      736              
  Lines       31407    31422      +15     
  Branches     5809     5513     -296     
==========================================
+ Hits        27944    27957      +13     
- Misses       3265     3421     +156     
+ Partials      198       44     -154     
Files with missing lines Coverage Δ
src/earn/poolInfoScreen/EarnPoolInfoScreen.tsx 93.82% <ø> (ø)

... and 76 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 c9bc051...981d640. Read the comment docs.

Comment on lines 272 to 273
startFadeInPosition: titleHeight - titleHeight * 0.9,
animationDistance: titleHeight * 0.66,
Copy link
Contributor

Choose a reason for hiding this comment

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

can we document these magic numbers? And any reason why they are changing to different values, when compared to the existing one where both were 0.33

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These are the values I found when testing locally that rendered the title in the header best. Moving to a single line for the token icon and title means we want a higher fade-in position and a lower animation distance. Alternatively, we could move the chain name and protocol name out of the header and compute the title height better, but that was a bigger change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added a comment and simplified a bit in e08941d.

<TokenIcons tokensInfo={tokensInfo} />
<Text style={styles.title}>{title}</Text>
<View style={styles.titleTokenContainer}>
<View style={styles.titleTokenIconContainer}>
Copy link
Contributor

Choose a reason for hiding this comment

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

for my understanding, what's the purpose of this extra wrapper View?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wrapped the token icon in an extra view to shrink it down; otherwise, it'll take up the whole line.

Copy link
Contributor

@satish-ravi satish-ravi Nov 13, 2024

Choose a reason for hiding this comment

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

ok, seems like having flexShrink: 1 does not really make a difference? and just the wrapper View without style should suffice, so maybe we can drop the style?

@MuckT MuckT added this pull request to the merge queue Nov 13, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 13, 2024
@MuckT MuckT enabled auto-merge November 13, 2024 08:03
@MuckT MuckT added this pull request to the merge queue Nov 13, 2024
Merged via the queue into main with commit ab5e17a Nov 13, 2024
15 checks passed
@MuckT MuckT deleted the tomm/act-1442 branch November 13, 2024 09:45
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