-
Notifications
You must be signed in to change notification settings - Fork 192
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
Implement Fund Card component #1718
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
`} | ||
</style> | ||
|
||
<div className="flex" style={{ height: '78px' }}> |
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.
Stick to tailwind classes for consistency
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.
preferably h-20
here
className={cn( | ||
text.body, | ||
'border-none bg-transparent', | ||
'text-[3.75rem] leading-none outline-none', |
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.
should be text-6xl
instead of arbitrary
className={cn( | ||
text.body, | ||
'border-none bg-transparent', | ||
'text-[3.75rem] leading-none outline-none', |
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.
text-6xl
style={{ | ||
position: 'absolute', | ||
opacity: 0, | ||
whiteSpace: 'nowrap', | ||
pointerEvents: 'none', | ||
}} |
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.
move into Tailwind utilities for consistency
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.
@dschlabach Where is the Tailwing utilities? I can't find any in the codebase. (The css I see is autogenerated and I can't add anything there)
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.
All Tailwind utilities are accessible anywhere in /src. You can apply them directly as classes. https://tailwindcss.com/docs/utility-first
@@ -11,7 +13,7 @@ export const successSvg = ( | |||
<title>Success SVG</title> | |||
<path | |||
d="M8 0C3.58 0 0 3.58 0 8C0 12.42 3.58 16 8 16C12.42 16 16 12.42 16 8C16 3.58 12.42 0 8 0ZM6.72667 11.5333L3.73333 8.54L4.67333 7.6L6.72667 9.65333L11.44 4.94L12.38 5.88L6.72667 11.5333Z" | |||
fill="#65A30D" | |||
className={className} |
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.
This will break color styling
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.
@dschlabach It used to be hardcoded 65A30D
, and now I'm using icon.success
. Do you mean that icon.success
is a different tone than 65A30D
?
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.
This is likely hardcoded because the icon fill color should not update based off of themes / modes
@@ -11,7 +13,7 @@ export const errorSvg = ( | |||
<title>Error SVG</title> | |||
<path | |||
d="M8 16C12.4183 16 16 12.4183 16 8C16 3.58171 12.4183 0 8 0C3.58172 0 0 3.58171 0 8C0 12.4183 3.58172 16 8 16ZM11.7576 5.0909L8.84853 8L11.7576 10.9091L10.9091 11.7576L8 8.84851L5.09093 11.7576L4.2424 10.9091L7.15147 8L4.2424 5.0909L5.09093 4.24239L8 7.15145L10.9091 4.24239L11.7576 5.0909Z" | |||
fill="#E11D48" | |||
className={className} |
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.
This will break color styling
@@ -12,7 +14,7 @@ export const coinbasePaySvg = ( | |||
fillRule="evenodd" | |||
clipRule="evenodd" | |||
d="M10.0145 14.1666C7.82346 14.1666 6.04878 12.302 6.04878 9.99996C6.04878 7.69788 7.82346 5.83329 10.0145 5.83329C11.9776 5.83329 13.6069 7.33677 13.9208 9.30552H17.9163C17.5793 5.02774 14.172 1.66663 10.0145 1.66663C5.63568 1.66663 2.08301 5.39926 2.08301 9.99996C2.08301 14.6007 5.63568 18.3333 10.0145 18.3333C14.172 18.3333 17.5793 14.9722 17.9163 10.6944H13.9208C13.6069 12.6632 11.9776 14.1666 10.0145 14.1666Z" | |||
fill="#f9fafb" | |||
className={className} |
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.
Doesn't this break default styling in things like CheckoutButton
?
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 have set color icon.foreground
by default
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.
This will break the default styling for this SVG when themes are applied. If you need a CoinbasePaySVG to update then we might have to create a new SVG for that
@@ -49,6 +51,7 @@ export function TextInput({ | |||
|
|||
return ( | |||
<input | |||
style={style} |
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.
Why do we need to add an inline style attribute here? We should try to stick to className
for consistency
src/fund/components/FundCard.tsx
Outdated
/** | ||
* Fetches and sets the exchange rate for the asset | ||
*/ | ||
useExchangeRate(assetSymbol); |
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.
Should this be moved into the provider or is there a reason it's here? A bit hard to tell what side effect it's having
src/internal/svg/coinbasePaySvg.tsx
Outdated
width="16" | ||
height="16" |
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.
We should lean towards width 100% and height 100% - This allows for more flexible icons, leaving the sizing to the parent component.
I recommend splitting this into smaller PRs, it will make reviewing and updating a lot easier and faster! |
What changed? Why?
Implemented a new component
FundCard
P/PS: https://docs.google.com/document/d/1y57fxsga2ZLF8-ieH2OY7jvqx5468txQuek1WTYPBxE/edit?tab=t.0
Usage:
Component is customizable and there are few components that can be passed into it.
Notes to reviewers
Overall component structure:
How has it been tested?