-
Notifications
You must be signed in to change notification settings - Fork 114
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
Conversation
10f1a1a
to
4edcb3a
Compare
4edcb3a
to
8af07a6
Compare
if (amount === undefined) { | ||
return ''; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fail more gracefully
@@ -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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh interesting, why?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
55608f4
to
b4c466b
Compare
src/token/components/TokenRow.tsx
Outdated
|
||
export const TokenRow = memo(function TokenRow({ token, amount, onClick }: TokenRowReact) { | ||
return ( | ||
<div data-testid="tokenRow" style={styles.row} onClick={() => onClick?.(token)}> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
src/token/components/TokenRow.tsx
Outdated
<div data-testid="tokenRow" style={styles.row} onClick={() => onClick?.(token)}> | ||
<div style={styles.left}> | ||
{token.image === null ? ( | ||
<div data-testid="noTokenImage" style={styles.circle} /> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
b4c466b
to
ec08d65
Compare
There was a problem hiding this 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.
What changed? Why?
Notes to reviewers
How has it been tested?
locally