Fujicracy / fuji-v2

Cross-chain money market aggregator
https://fuji-v2-frontend.vercel.app
15 stars 10 forks source link

Transaction confirmation modal #434

Closed NikolaiYurchenko closed 1 year ago

NikolaiYurchenko commented 1 year ago

Transaction corfirmation flow rework; LtvWarning modal removed Modal pops after approval if needed

ferostabio commented 1 year ago
ferostabio commented 1 year ago

@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.

ferostabio commented 1 year ago

Routes still have varying line heights depending if there's an icon or not.

Captura de pantalla 2023-04-06 a la(s) 11 48 26
ferostabio commented 1 year ago
ferostabio commented 1 year ago

@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.

ferostabio commented 1 year ago

@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)
github-actions[bot] commented 1 year ago

Please test this PR on: https://v2-staging-434-dot-fuji-306908.ey.r.appspot.com

NikolaiYurchenko commented 1 year ago

@brozorec made changes we talked about. Please check You were right, if we dont need those helpers right now, code became a little smaller