Skip to content

Commit 2b87716

Browse files
authored
Collateral Swaps using CoW when available (#2581)
1 parent 370bfdf commit 2b87716

55 files changed

Lines changed: 2025 additions & 995 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pages/_app.page.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { AddressBlocked } from 'src/components/AddressBlocked';
1616
import { Meta } from 'src/components/Meta';
1717
import { TransactionEventHandler } from 'src/components/TransactionEventHandler';
1818
import { GasStationProvider } from 'src/components/transactions/GasStation/GasStationProvider';
19-
import { CowOrderToast } from 'src/components/transactions/Switch/CowOrderToast';
19+
import { CowOrderToast } from 'src/components/transactions/Switch/cowprotocol/CowOrderToast';
2020
import { AppDataProvider } from 'src/hooks/app-data-provider/useAppDataProvider';
2121
import { CowOrderToastProvider } from 'src/hooks/useCowOrderToast';
2222
import { ModalContextProvider } from 'src/hooks/useModal';
@@ -35,6 +35,12 @@ const SwitchModal = dynamic(() =>
3535
import('src/components/transactions/Switch/SwitchModal').then((module) => module.SwitchModal)
3636
);
3737

38+
const CollateralSwapModal = dynamic(() =>
39+
import('src/components/transactions/Switch/CollateralSwap/CollateralSwapModal').then(
40+
(module) => module.CollateralSwapModal
41+
)
42+
);
43+
3844
const BridgeModal = dynamic(() =>
3945
import('src/components/transactions/Bridge/BridgeModal').then((module) => module.BridgeModal)
4046
);
@@ -69,9 +75,6 @@ const RepayModal = dynamic(() =>
6975
const SupplyModal = dynamic(() =>
7076
import('src/components/transactions/Supply/SupplyModal').then((module) => module.SupplyModal)
7177
);
72-
const SwapModal = dynamic(() =>
73-
import('src/components/transactions/Swap/SwapModal').then((module) => module.SwapModal)
74-
);
7578
const WithdrawModal = dynamic(() =>
7679
import('src/components/transactions/Withdraw/WithdrawModal').then(
7780
(module) => module.WithdrawModal
@@ -166,10 +169,10 @@ export default function MyApp(props: MyAppProps) {
166169
<DebtSwitchModal />
167170
<ClaimRewardsModal />
168171
<EmodeModal />
169-
<SwapModal />
170172
<FaucetModal />
171173
<TransactionEventHandler />
172174
<SwitchModal />
175+
<CollateralSwapModal />
173176
<StakingMigrateModal />
174177
<BridgeModal />
175178
<ReadOnlyModal />

src/components/lists/ListWrapper.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ interface ListWrapperProps {
1818
wrapperSx?: BoxProps['sx'];
1919
tooltipOpen?: boolean;
2020
paperSx?: PaperProps['sx'];
21+
topInfoSx?: BoxProps['sx'];
2122
}
2223

2324
export const ListWrapper = ({
@@ -32,6 +33,7 @@ export const ListWrapper = ({
3233
wrapperSx,
3334
tooltipOpen,
3435
paperSx,
36+
topInfoSx,
3537
}: ListWrapperProps) => {
3638
const [isCollapse, setIsCollapse] = useState(
3739
localStorageName ? localStorage.getItem(localStorageName) === 'true' : false
@@ -170,6 +172,7 @@ export const ListWrapper = ({
170172
px: { xs: 4, xsm: 6 },
171173
pb: { xs: collapsed && !noData ? 6 : 2, xsm: collapsed && !noData ? 6 : 0 },
172174
overflowX: tooltipOpen ? 'hidden' : 'auto',
175+
...topInfoSx,
173176
}}
174177
>
175178
{topInfo}

src/components/primitives/BasicModal.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface BasicModalProps {
88
setOpen: (value: boolean) => void;
99
withCloseButton?: boolean;
1010
contentMaxWidth?: number;
11+
minContentHeight?: number;
1112
contentHeight?: number;
1213
closeCallback?: () => void;
1314
disableEnforceFocus?: boolean;
@@ -19,6 +20,7 @@ export const BasicModal = ({
1920
setOpen,
2021
withCloseButton = true,
2122
contentMaxWidth = 420,
23+
minContentHeight,
2224
contentHeight,
2325
children,
2426
closeCallback,

src/components/primitives/TokenIcon.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ interface ExternalTokenIconProps extends IconProps {
199199

200200
export function ExternalTokenIcon({ symbol, logoURI, ...rest }: ExternalTokenIconProps) {
201201
const [tokenSymbol, setTokenSymbol] = useState(symbol.toLowerCase());
202+
202203
return (
203204
<Icon {...rest} sx={{ display: 'flex', position: 'relative', borderRadius: '50%', ...rest.sx }}>
204205
<LazyLoad>

src/components/transactions/Swap/SwapModal.tsx

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)