-
Notifications
You must be signed in to change notification settings - Fork 1
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: detailed balance for web, user view #2342
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
e5b068a
to
06ed7d5
Compare
@@ -129,6 +129,12 @@ export const useGetDollarBalance = () => { | |||
}; | |||
}; | |||
|
|||
export const useBalanceToUsd = () => { |
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 this wrapper around useTezToDollar
?
@@ -13,7 +13,7 @@ const tabs = [ | |||
to: "/nfts", | |||
}, | |||
{ | |||
label: "Earn", |
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 think we can keep as Earn and give user a choice to delegate or stake
}); | ||
|
||
describe("Delegation and staking", () => { | ||
// beforeEach(() => { |
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 this is commented?
import { IconButtonWithText } from "../IconButtonWithText"; | ||
import { useIsAccountVerified } from "../Onboarding/VerificationFlow"; | ||
|
||
const RoundStatusDot = ({ background }: { background: string }) => ( |
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 would move all the staking/delegating related code to the separate component <AccountSpendableInfo />
or something like this and put it close to <AccountBalance />
component
const balance = useGetAccountBalance()(address); | ||
const usdBalance = useGetDollarBalance()(address); | ||
const buyTezUrl = useBuyTezUrl(address); | ||
const spendableBalance = BigNumber(useGetAccountBalance()(address) ?? 0); |
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.
Please move all the code related to spendable into separate hook like useSpendableBalance
and export all that you need
</Flex> | ||
</Flex> | ||
{delegate && <AddressPill address={delegate} data-testid="current-baker" />} | ||
{!spendableBalance.isEqualTo(totalBalance) && ( |
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 the code below looks the same, except data-testid, balance and label so we can make a reusable generic component which take appropriate props
Proposed changes
UMA-1037
Added detailed balance view:
Types of changes
Steps to reproduce
Open main screen.
Play with stake/delegate/unstake
Screenshots
Add the screenshots of how the app used to look like and how it looks now
Checklist