From bd9bb93f1d45e052cd311d46d7d6213cc660b941 Mon Sep 17 00:00:00 2001 From: mintdart <96025197+mintdart@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:52:09 -0600 Subject: [PATCH 1/5] update butttons --- .../Aggregator/hooks/useTokenApprove.ts | 4 +- src/components/Aggregator/index.tsx | 272 ++++++++++-------- 2 files changed, 153 insertions(+), 123 deletions(-) diff --git a/src/components/Aggregator/hooks/useTokenApprove.ts b/src/components/Aggregator/hooks/useTokenApprove.ts index e65ebbe0..f7f5f3d0 100644 --- a/src/components/Aggregator/hooks/useTokenApprove.ts +++ b/src/components/Aggregator/hooks/useTokenApprove.ts @@ -235,11 +235,9 @@ export const useTokenApprove = ({ approve, approveInfinite, approveReset, - isLoading: isFetchingAllowance || isLoading, + isFetchingAllowance, isConfirmingApproval: isLoading, - isInfiniteLoading: isInfiniteLoading, isConfirmingInfiniteApproval: isInfiniteLoading, - isResetLoading: isResetLoading, isConfirmingResetApproval: isResetLoading, allowance, shouldRemoveApproval, diff --git a/src/components/Aggregator/index.tsx b/src/components/Aggregator/index.tsx index 3098cd66..774b10ab 100644 --- a/src/components/Aggregator/index.tsx +++ b/src/components/Aggregator/index.tsx @@ -7,7 +7,6 @@ import { ArrowDown } from 'react-feather'; import styled from 'styled-components'; import { useToast, - Button, FormControl, FormLabel, Switch, @@ -293,6 +292,24 @@ const ConnectButtonWrapper = styled.div` } `; +const Button = styled.button` + background: #a2cdff; + color: #1a202c; + border-radius: 6px; + font-size: 16px; + font-weight: 600; + display: flex; + gap: 4px; + align-items: center; + justify-content: center; + padding: 8px; + + &:disabled { + cursor: not-allowed; + opacity: 0.6; + } +`; + export const SwapInputArrow = (props) => ( } @@ -726,9 +743,7 @@ export function AggregatorContainer({ tokenList }) { approve, approveInfinite, approveReset, - isLoading: isApproveLoading, - isInfiniteLoading: isApproveInfiniteLoading, - isResetLoading: isApproveResetLoading, + isFetchingAllowance, isConfirmingApproval, isConfirmingInfiniteApproval, isConfirmingResetApproval, @@ -1155,12 +1170,9 @@ export function AggregatorContainer({ tokenList }) { {!isConnected ? ( - + ) : !isValidSelectedChain ? ( ) : insufficientBalance ? ( - + ) : !selectedRoute && isSmallScreen && finalSelectedFromToken && finalSelectedToToken ? ( - + ) : hasMaxPriceImpact && !isDegenModeEnabled ? ( - + ) : ( <> {router && address && ( @@ -1206,15 +1212,19 @@ export function AggregatorContainer({ tokenList }) { need to reset your approval and approve again`} )} @@ -1228,18 +1238,6 @@ export function AggregatorContainer({ tokenList }) { /> ) : ( )} {!isApproved && selectedRoute && inifiniteApprovalAllowed.includes(selectedRoute.name) && ( )} {isSmallScreen && warnings?.length ? ( - @@ -1333,12 +1344,7 @@ export function AggregatorContainer({ tokenList }) { {!isApproved && selectedRoute ? ( - @@ -1449,7 +1455,6 @@ export function AggregatorContainer({ tokenList }) { ) : !isValidSelectedChain ? ( )} @@ -1504,20 +1513,6 @@ export function AggregatorContainer({ tokenList }) { /> ) : ( )} {!isApproved && selectedRoute && inifiniteApprovalAllowed.includes(selectedRoute.name) && ( )} {!isApproved && selectedRoute ? ( ) : null} @@ -1336,7 +1335,7 @@ export function AggregatorContainer() { {!isApproved && selectedRoute ? ( - @@ -1503,15 +1502,19 @@ export function AggregatorContainer() { selectedRoute.price.isSignatureNeededForSwap && (selectedRoute.price.rawQuote as any).permit2 ? ( ) : null} @@ -1625,10 +1628,7 @@ export function AggregatorContainer() { {!isApproved && selectedRoute ? ( - From 2d7d217c18e8c54bd3a745624e8e35ccc113a465 Mon Sep 17 00:00:00 2001 From: mintdart <96025197+mintdart@users.noreply.github.com> Date: Sat, 10 May 2025 10:04:03 +0900 Subject: [PATCH 5/5] fix --- src/components/Aggregator/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Aggregator/index.tsx b/src/components/Aggregator/index.tsx index d3e5c66b..4053d8fb 100644 --- a/src/components/Aggregator/index.tsx +++ b/src/components/Aggregator/index.tsx @@ -1703,7 +1703,7 @@ const SpinnerWrapper = styled.svg` const Spinner = () => { return ( - +