-
Notifications
You must be signed in to change notification settings - Fork 254
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
fix: improve Earn
transaction success state
#1973
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Earn
transaction success state
* @param durationMs - Duration in milliseconds before the value resets | ||
* @returns [value, setValue] - Current value and setter function | ||
*/ | ||
export function useTemporaryValue<T>( |
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.
Just curious what the use case for this is
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.
Good call, was for a previous implementation, I'll delete it.
@@ -11,7 +11,7 @@ function EarnWithdrawDefaultContent() { | |||
<EarnDetails /> | |||
<WithdrawAmountInput /> | |||
<WithdrawBalance /> | |||
<WithdrawButton className="h-12" /> | |||
<WithdrawButton className="-mt-4 h-12" /> |
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.
nit: I just feel like we shouldn't be updating the component through classNames here. And we should directly change inside the WithdrawButton component?
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.
discussed offline 👍🏻
throw new Error( | ||
'Vault not found. Ensure the address is a valid Morpho vault on Base.', | ||
); | ||
} |
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 throw a generic error on any other error?
setLifecycleStatus({ | ||
statusName: 'reset', | ||
statusData: null, | ||
}); |
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 just reset to init?
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 I can remove it, I guess there's no real value in a reset
}, [receipt]); | ||
if (resetAfter) { | ||
// Reset all internal state | ||
const timeoutId = setTimeout(() => { |
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.
does this need to be handled in getTransactionLegacyReceipts too?
What changed? Why?
This PR includes several quality of live improvements:
<Earn />
title
attribute to truncated elementsNotes to reviewers
How has it been tested?