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(assets): add token details screen #4266

Merged
merged 9 commits into from
Oct 10, 2023
Merged

feat(assets): add token details screen #4266

merged 9 commits into from
Oct 10, 2023

Conversation

satish-ravi
Copy link
Contributor

@satish-ravi satish-ravi commented Oct 5, 2023

Description

Figma

Test plan

Unit tests, manual by enabling dummy feature flag

Showing all actions with swap enabled:

asset-details.mp4

Showing actions with swap disabled (withdraw is hidden behind more):

asset-details-no-swap.mp4

Related issues

Backwards compatibility

Yes

@cajubelt
Copy link
Contributor

cajubelt commented Oct 6, 2023

just from the videos-

  • the bottom sheet when "more" is clicked isn't in the demo video
  • the "withdraw" icon looks kinda close to the edge. it's not in the designs, so this is pretty subjective

very cool though!

Copy link
Contributor

@cajubelt cajubelt left a comment

Choose a reason for hiding this comment

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

main concerns are a type cast and a potential conflict with Tom's PR-- can you work with him to resolve it?

nothing major so I'm approving also

src/tokens/hooks.ts Outdated Show resolved Hide resolved
src/tokens/hooks.ts Outdated Show resolved Hide resolved
src/tokens/hooks.ts Outdated Show resolved Hide resolved
src/tokens/hooks.ts Show resolved Hide resolved
text: t('tokenDetails.actions.send'),
iconComponent: QuickActionsSend,
onPress: () => {
navigate(Screens.Send, { defaultTokenOverride: token.address! })
Copy link
Contributor

Choose a reason for hiding this comment

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

I recently saw a refactor here by @MuckT that changes the meaning of defaultTokenOverride from address to tokenId, but the type is still string. Some faint alarm bell went off when I saw that, and I'm realizing now that I was worried that one of you could merge the changes without seeing this change and we'd end up with a bug. @MuckT what do you think should be done to prevent this? Maybe the defaultTokenOverride parameter name could be changed (in Tom's PR) so we get a compilation error if someone makes this mistake

Copy link
Collaborator

Choose a reason for hiding this comment

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

Happy to change it from defaultTokenOverride to defaultTokenIdOverride in #4242.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Left a TODO, so this can be addressed depending on which one merges first

Copy link
Contributor

Choose a reason for hiding this comment

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

I think Tom's suggestion of changing the variable name is safer, since it doesn't depend on merge order-- in either case, a build error should take place if one is merged without the other taking the changes into account yet

iconComponent: QuickActionsAdd,
onPress: () => {
navigate(Screens.FiatExchangeAmount, {
currency: token.symbol as CiCoCurrency,
Copy link
Contributor

Choose a reason for hiding this comment

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

this type cast seems to rely on the internal logic of useCashInTokens, which could change and cause a bug here...

Copy link
Contributor

Choose a reason for hiding this comment

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

same with the following one

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 an explicit condition on the navigate function

src/tokens/TokenDetails.tsx Outdated Show resolved Hide resolved
src/tokens/TokenDetails.tsx Outdated Show resolved Hide resolved
@satish-ravi
Copy link
Contributor Author

@cajubelt

  • the more bottom sheet is out of scope for this and will be covered in a separate ticket.
  • I've been chatting w/ Nitya on the Withdraw button, I think she's ok with this since for most users swap would be enabled and withdraw will only pop up on the bottom sheet. This would also be a problem for all buttons in other languages if there are longer names, but I think we can hold off on optimizing it for all languages now.

@codecov
Copy link

codecov bot commented Oct 8, 2023

Codecov Report

Merging #4266 (2c80e3f) into main (6c92e6a) will increase coverage by 0.03%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4266      +/-   ##
==========================================
+ Coverage   83.96%   83.99%   +0.03%     
==========================================
  Files         705      711       +6     
  Lines       25966    26131     +165     
  Branches     3361     3385      +24     
==========================================
+ Hits        21803    21950     +147     
- Misses       4099     4117      +18     
  Partials       64       64              
Files Coverage Δ
src/analytics/Events.tsx 100.00% <100.00%> (ø)
src/components/Button.tsx 100.00% <100.00%> (ø)
src/config.ts 96.93% <ø> (-0.04%) ⬇️
src/icons/ArrowRightThick.tsx 100.00% <100.00%> (ø)
src/icons/DataDown.tsx 100.00% <100.00%> (ø)
src/icons/DataUp.tsx 100.00% <100.00%> (ø)
src/icons/quick-actions/More.tsx 100.00% <100.00%> (ø)
src/navigator/Screens.tsx 100.00% <100.00%> (ø)
src/statsig/constants.ts 100.00% <ø> (ø)
src/styles/fonts.tsx 100.00% <ø> (ø)
... and 9 more

... and 1 file 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 6c92e6a...2c80e3f. Read the comment docs.

src/tokens/TokenDetails.tsx Outdated Show resolved Hide resolved
src/tokens/TokenDetails.tsx Outdated Show resolved Hide resolved
@satish-ravi satish-ravi enabled auto-merge (squash) October 10, 2023 01:41
@satish-ravi satish-ravi merged commit a3afdd0 into main Oct 10, 2023
15 checks passed
@satish-ravi satish-ravi deleted the satish/act-915 branch October 10, 2023 02:58
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