-
Notifications
You must be signed in to change notification settings - Fork 237
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: add earn balance cards #1873
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/earn/components/EarnBalance.tsx
Outdated
const handleKeyDown = useCallback( | ||
(e: React.KeyboardEvent) => { | ||
if (e.key === 'Enter') { | ||
e.preventDefault(); | ||
onActionPress(); | ||
} | ||
}, | ||
[onActionPress], | ||
); |
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 doesn't the browser just handle this?
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.
yeah it should the linter got mad let me double check
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.
removed
const [depositAmount, setDepositAmount] = useState(''); | ||
const [withdrawAmount, setWithdrawAmount] = useState(''); | ||
|
||
const { convertedBalance } = useGetTokenBalance(address, usdcToken); |
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.
May be fine for testing but will probably have to make this more generic given we will try and support all vaults not just USDC
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.
yeah lets leave as is and revisit when we're hooking up the actions
export function DepositBalance({ className }: DepositBalanceReact) { | ||
const { convertedBalance, setDepositAmount } = useEarnContext(); | ||
|
||
const handleUseMaxPress = useCallback(() => { |
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 we remove use
since this is not a hook? Also, what is a press? Thoughts on something like handleMaxAmount
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 yeah use max is the text of the button so i thought it made sense
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.
Ohhh I see the buttons called "Use Max"
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.
Might be a question for Mind, but I feel like the button should just say "Max" - I think this is what most DEX's do
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.
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 a little confused by that too, so I'd probably advocate for handleMaxAmount. Use is redundant
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.
sounds good i'll update the function name and check with mind on the text
dbec1b6
to
8e4dc30
Compare
What changed? Why?
Notes to reviewers
How has it been tested?