Skip to content

Commit

Permalink
Merge branch 'fix/ui-20240801' into tmp/20240731
Browse files Browse the repository at this point in the history
  • Loading branch information
vvvvvv1vvvvvv committed Aug 1, 2024
2 parents a39380c + c4b4580 commit 52e74e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/ui/views/Bridge/Component/BridgeContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ export const BridgeContent = () => {

const quoteOrAmountLoading = quoteLoading || payAmountLoading;

const amountAvailable = useMemo(() => Number(debouncePayAmount) > 0, [
debouncePayAmount,
]);

const aggregatorIds = useRabbySelector(
(s) => s.bridge.aggregatorsList.map((e) => e.id) || []
);
Expand Down Expand Up @@ -386,13 +390,14 @@ export const BridgeContent = () => {
/>

{quoteOrAmountLoading &&
amountAvailable &&
!inSufficient &&
!selectedBridgeQuote?.manualClick && <BestQuoteLoading />}

{payToken &&
!inSufficient &&
receiveToken &&
Number(debouncePayAmount) > 0 &&
amountAvailable &&
(!quoteOrAmountLoading || selectedBridgeQuote?.manualClick) && (
<BridgeReceiveDetails
openQuotesList={openQuotesList}
Expand Down Expand Up @@ -484,6 +489,7 @@ export const BridgeContent = () => {
disabled={
!payToken ||
!receiveToken ||
!amountAvailable ||
inSufficient ||
payAmountLoading ||
!selectedBridgeQuote
Expand Down
8 changes: 7 additions & 1 deletion src/ui/views/Swap/Component/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ export const Main = () => {

const quoteOrAmountLoading = quoteLoading || payAmountLoading;

const amountAvailable = useMemo(() => Number(debouncePayAmount) > 0, [
debouncePayAmount,
]);

const btnText = useMemo(() => {
if (slippageChanged) {
return t('page.swap.slippage-adjusted-refresh-quote');
Expand Down Expand Up @@ -450,11 +454,13 @@ export const Main = () => {
/>

{quoteOrAmountLoading &&
amountAvailable &&
!inSufficient &&
!activeProvider?.manualClick && <BestQuoteLoading />}

{Number(debouncePayAmount) > 0 &&
!inSufficient &&
amountAvailable &&
(!quoteOrAmountLoading ||
(activeProvider && !!activeProvider.manualClick)) &&
payToken &&
Expand Down Expand Up @@ -589,7 +595,7 @@ export const Main = () => {
disabled={
!payToken ||
!receiveToken ||
!debouncePayAmount ||
!amountAvailable ||
inSufficient ||
payAmountLoading ||
!activeProvider
Expand Down

0 comments on commit 52e74e4

Please sign in to comment.