Skip to content

Commit

Permalink
Merge pull request #134 from ionicprotocol/development
Browse files Browse the repository at this point in the history
UI fixes
  • Loading branch information
rhlsthrm authored Jan 30, 2024
2 parents 21cfa25 + fccb7aa commit 471c1f2
Show file tree
Hide file tree
Showing 6 changed files with 553 additions and 216 deletions.
1 change: 0 additions & 1 deletion packages/ui/app/_components/ResultHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export default function ResultHandler({
margin: center ? 'auto' : '0px'
}}
ariaLabel="three-circles-loading"
wrapperClass=""
/>
);
}
Expand Down
33 changes: 23 additions & 10 deletions packages/ui/app/_components/popup/Amount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { MarketData } from '@ui/types/TokensDataMap';
import dynamic from 'next/dynamic';
import React, { useState } from 'react';
import { useAccount, useBalance } from 'wagmi';
import ResultHandler from '../ResultHandler';

interface IAmount {
selectedMarketData: MarketData;
Expand All @@ -12,14 +13,16 @@ interface IAmount {
hintText?: string;
max?: number;
symbol: string;
isLoading?: boolean;
}
const Amount = ({
selectedMarketData,
handleInput,
amount,
hintText = 'Wallet Balance',
max = 0,
symbol
symbol,
isLoading = false
}: IAmount) => {
const marketDataDecimals = parseInt(
selectedMarketData.underlyingDecimals.toString()
Expand All @@ -39,15 +42,25 @@ const Amount = ({
<div className={`w-full flex-col items-start justify-start`}>
<div className={`flex w-full items-center text-[10px] text-white/50 `}>
<span className={``}>Amount</span>
<span className={`ml-auto`}>
{hintText} {max.toFixed(marketDataDecimals)}
</span>
<button
onClick={() => handleMax(max)}
className={`text-accent pl-2`}
>
MAX
</button>
<div className="ml-auto">
<ResultHandler
width="15"
height="15"
isLoading={isLoading}
>
<>
<span className={`ml-auto`}>
{hintText} {max.toFixed(marketDataDecimals)}
</span>
<button
onClick={() => handleMax(max)}
className={`text-accent pl-2`}
>
MAX
</button>
</>
</ResultHandler>
</div>
</div>
<div
className={`flex w-full pt-1.5 items-center text-lg text-white/50 `}
Expand Down
Loading

0 comments on commit 471c1f2

Please sign in to comment.