Skip to content

Commit df078c0

Browse files
authored
Merge pull request QuickSwap#1658 from QuickSwap/soneium_bridge
Add a Bridge page on Soneium
2 parents 9a75562 + 056f2c5 commit df078c0

7 files changed

Lines changed: 23 additions & 11 deletions

File tree

public/bridge/soneium.webp

920 Bytes
Loading
2.62 KB
Loading
3.91 KB
Loading
704 Bytes
Loading

src/components/Header/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ const Header: React.FC<{ onUpdateNewsletter: (val: boolean) => void }> = ({
260260
});
261261
}
262262

263-
if (chainId !== ChainId.SONEIUM && isSupportedNetwork)
263+
if (isSupportedNetwork)
264264
menuItems.push({
265265
link: '/bridge',
266266
text: t('Bridge'),

src/config/soneium.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
"symbol": "ETH",
1414
"decimals": 18
1515
},
16+
"bridgeUrl": "https://superbridge.app/soneium",
17+
"bridge": {
18+
"bridgeCoverImg": "/bridge/soneium_cover_img.webp",
19+
"thirdParty": true,
20+
"supportedChains": ["/bridge/eth.svg", "/bridge/soneium.webp"],
21+
"isBigCoverImg": true
22+
},
1623
"swap": {
1724
"available": true,
1825
"bestTrade": false,
@@ -98,4 +105,4 @@
98105
"available": false
99106
},
100107
"poolInitCodeHash": "0xb3fc09be5eb433d99b1ec89fd8435aaf5ffea75c1879e19028aa2414a14b3c85"
101-
}
108+
}

src/pages/Bridge/BridgePage.tsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ import layer from 'assets/images/bridge/layer.svg';
2727
import squid from 'assets/images/bridge/squid.webp';
2828
import retr from 'assets/images/bridge/retr.webp';
2929
import rubic from 'assets/images/bridge/rubic.webp';
30+
import across from 'assets/images/bridge/across.webp';
31+
import soneium from 'assets/images/bridge/soneium.webp';
32+
3033
import ArrowForwardIcon from '@material-ui/icons/ArrowForward';
3134
import { useActiveWeb3React } from 'hooks';
3235
import { getConfig } from 'config';
@@ -42,13 +45,6 @@ const BridgePage: React.FC = ({}) => {
4245
// return config && config.visible;
4346
// });
4447

45-
useEffect(() => {
46-
if (chainId === ChainId.SONEIUM) {
47-
history.push('/');
48-
}
49-
// eslint-disable-next-line react-hooks/exhaustive-deps
50-
}, [chainId]);
51-
5248
const currentChain = useMemo(() => {
5349
return getConfig(chainId);
5450
}, [chainId]);
@@ -146,6 +142,11 @@ const BridgePage: React.FC = ({}) => {
146142
isSmallImage: true,
147143
externalLink: 'https://app.rubic.exchange/',
148144
},
145+
{
146+
image: across,
147+
chains: [eth, polygon, soneium],
148+
externalLink: 'https://app.across.to/bridge',
149+
},
149150
];
150151

151152
return (
@@ -170,7 +171,9 @@ const BridgePage: React.FC = ({}) => {
170171
marginBottom: '16px',
171172
}}
172173
>
173-
Chain Native Bridge
174+
{currentChain?.bridge?.thirdParty
175+
? `${currentChain?.networkName} Official Third Party Bridge `
176+
: 'Chain Native Bridge'}
174177
</Typography>
175178
<Box
176179
style={{
@@ -214,7 +217,9 @@ const BridgePage: React.FC = ({}) => {
214217
marginBottom: '28px',
215218
}}
216219
>
217-
{`${currentChain?.networkName}'s Native Bridge`}
220+
{currentChain?.bridge?.thirdParty
221+
? `${currentChain?.networkName} Official Third Party Bridge`
222+
: `${currentChain?.networkName}'s Native Bridge`}
218223
</Typography>
219224
<Box className='flex items-center justify-center'>
220225
{currentChain?.bridge?.supportedChains?.map(

0 commit comments

Comments
 (0)