Skip to content

Commit

Permalink
Merge pull request #938 from mrgnlabs/fix/mrgn-loop-max-amount
Browse files Browse the repository at this point in the history
feat(mfi-v2-ui): looper fixes
  • Loading branch information
k0beLeenders authored Oct 31, 2024
2 parents 80c45f2 + b961623 commit 4acbe55
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ type LoopActionProps = {
export const LoopAction = ({
walletAmount,
maxAmount,
amountRaw,
selectedBank,
selectedSecondaryBank,
onSetAmountRaw,
loopActionTxns,
}: LoopActionProps) => {
const numberFormater = React.useMemo(() => new Intl.NumberFormat("en-US", { maximumFractionDigits: 10 }), []);

Expand All @@ -45,8 +43,6 @@ export const LoopAction = ({
<li className="flex justify-between items-center gap-1.5">
<strong className="mr-auto">{maxLabel.label}</strong>
<div className="flex space-x-1">
{selectedBank?.isActive && <div>{clampedNumeralFormatter(selectedBank.position.amount)}</div>}
{selectedBank?.isActive && <IconArrowRight width={12} height={12} />}
<div>{maxLabel.amount}</div>
<button
className="cursor-pointer border-b border-transparent transition text-mfi-action-box-highlight hover:border-mfi-action-box-highlight"
Expand All @@ -57,15 +53,6 @@ export const LoopAction = ({
</button>
</div>
</li>
{loopActionTxns.actualDepositAmount > 0 && (
<li className="flex justify-between items-center gap-1.5">
<strong>Leveraged deposit:</strong>

<div className="flex space-x-1.5 items-center">
{`${Number(loopActionTxns?.actualDepositAmount.toFixed(4)) ?? "-"} ${selectedBank.meta.tokenSymbol}`}
</div>
</li>
)}
</ul>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const ActionButton = ({

return (
<Button disabled={isLoading || !isEnabled} className="w-full py-5" onClick={handleAction}>
{isLoading ? <Loader className="animate-spin" /> : buttonLabel}
{isLoading ? <Loader className={`${loaderType === "DEFAULT" && "animate-spin"}`} /> : buttonLabel}
</Button>
);
};

0 comments on commit 4acbe55

Please sign in to comment.