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: TokenRow component #399

Merged
merged 8 commits into from
May 29, 2024
Merged

feat: TokenRow component #399

merged 8 commits into from
May 29, 2024

Conversation

kyhyco
Copy link
Contributor

@kyhyco kyhyco commented May 28, 2024

What changed? Why?
Screenshot 2024-05-28 at 10 43 33 PM

Notes to reviewers

How has it been tested?
locally

Comment on lines +10 to +12
if (amount === undefined) {
return '';
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fail more gracefully

@kyhyco kyhyco marked this pull request as ready for review May 29, 2024 06:47
@kyhyco kyhyco requested a review from Zizzamia May 29, 2024 16:27
@Zizzamia Zizzamia requested review from 0xAlec and cpcramer May 29, 2024 16:31
.nvmrc Outdated Show resolved Hide resolved
@@ -59,7 +60,8 @@
"yarn": "^1.22.21"
},
"resolutions": {
"@coinbase/wallet-sdk": "npm:@coinbase/wallet-sdk@4.0.0"
"@coinbase/wallet-sdk": "npm:@coinbase/wallet-sdk@4.0.0",
"react": "npm:react@^18"
Copy link
Contributor

Choose a reason for hiding this comment

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

oh interesting, why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was getting errors on github actions with packemon v3.3.1 dependency boost/cli depending on react 16 / 17.

This is more of a temp fix and we need to upgrade packemon to v4 which uses a version of boost/cli that depends on react 18

Copy link
Contributor

Choose a reason for hiding this comment

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

ok


export const TokenRow = memo(function TokenRow({ token, amount, onClick }: TokenRowReact) {
return (
<div data-testid="tokenRow" style={styles.row} onClick={() => onClick?.(token)}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a fan of all these divs, I wonder if we can be a more semantic with our HTML tags

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Zizzamia Updated the root to be button and converted divs to spans. Marginally better... let me think on this a bit more.

<div data-testid="tokenRow" style={styles.row} onClick={() => onClick?.(token)}>
<div style={styles.left}>
{token.image === null ? (
<div data-testid="noTokenImage" style={styles.circle} />
Copy link
Contributor

Choose a reason for hiding this comment

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

because we share data-testid with other components, let's as standard a prefix_ like ockTokenRow_~~~

so ock + NameComponent + _ + ElToTest

a bit similar to what we did in https://github.com/coinbase/onchainkit/blob/main/src/identity/components/Avatar.tsx#L34

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what does ock stand for?

Copy link
Contributor

@Zizzamia Zizzamia left a comment

Choose a reason for hiding this comment

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

Amazing!!!

I am going to cut this as release and polish a couple of things out. But really love how this is shaping up.

@Zizzamia Zizzamia merged commit 7485234 into main May 29, 2024
9 checks passed
@Zizzamia Zizzamia deleted the ky.lee/feat/token-row branch May 29, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants