Closed NikolaiYurchenko closed 1 year ago
[x] In the route cards, the line is bigger when there are icons, so it looks a bit poor
[x] Borrow limit left
is always 0 when creating a new position. Did an operation with an LTV
of around 30%
, so it shouldn't be 0 at all. Also, there's already a borrowLimit
function in the assets
helper. While it has a bug atm, you can use it here. In this confirmation modal, the idea is to show how much could the user borrow. The "...left" part. So if the user is doing an operation with an LTV of 30%, it means they could borrow a lot more until getting the recommended value. That's what we want to show.
@NikolaiYurchenko you're still using a different function to calculate the borrowing limit and doing it twice. Please reuse the assets
function as mentioned earlier, pass different params in order to get different results and apply the changes to the result in order to get the calculation. We're duplicating code without need at the moment, this is going to be an issue in the future (btw, there shouldn't be any bugs left in the current implementation, make sure to grab internal-v2-testing's latest.
Routes still have varying line heights depending if there's an icon or not.
@brozorec @NikolaiYurchenko
1- Simplified the max borrow limit
function. Before it was more clear, but as Nicko said, there was no need to do a calculation since we already had the value to use!
2- The borrow limit left
function now calls the max borrow limit and works on its result. Also changed the params.
3- Renamed both so it's more clear what it is they actually do.
@NikolaiYurchenko
Passing
<BorrowButton
...
withConfirmation={proceedWithConfirmation}
/>
results in
Type '{ address: string | undefined; collateral: AssetChange; debt: AssetChange; position: Position; walletChain: ConnectedChain | undefined; ... 15 more ...; withConfirmation: (action: () => void) => void; }' is not assignable to type 'IntrinsicAttributes & BorrowButtonProps'.
Property 'withConfirmation' does not exist on type 'IntrinsicAttributes & BorrowButtonProps'.ts(2322)
Please test this PR on: https://v2-staging-434-dot-fuji-306908.ey.r.appspot.com
@brozorec made changes we talked about. Please check You were right, if we dont need those helpers right now, code became a little smaller
Transaction corfirmation flow rework; LtvWarning modal removed Modal pops after approval if needed