Merge pull request #454 from project-serum/revert-453-revert-452-wormhole-tab
Revert "Revert "chore: added wormhole tab for bridge""
This commit is contained in:
commit
125d59f12b
|
@ -63,7 +63,10 @@ export default function DepositDialog({
|
||||||
if (!mint) {
|
if (!mint) {
|
||||||
firstTab = 'SOL';
|
firstTab = 'SOL';
|
||||||
} else {
|
} else {
|
||||||
if (localStorage.getItem('sollet-private') || swapInfo.blockchain !== 'eth') {
|
if (
|
||||||
|
localStorage.getItem('sollet-private') ||
|
||||||
|
swapInfo.blockchain !== 'eth'
|
||||||
|
) {
|
||||||
secondTab = `${
|
secondTab = `${
|
||||||
swapInfo.coin.erc20Contract ? 'ERC20' : 'Native'
|
swapInfo.coin.erc20Contract ? 'ERC20' : 'Native'
|
||||||
} ${secondTab}`;
|
} ${secondTab}`;
|
||||||
|
@ -103,7 +106,20 @@ export default function DepositDialog({
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
{tabs}
|
{tabs === null ? (
|
||||||
|
<Tabs
|
||||||
|
value={tab}
|
||||||
|
variant="fullWidth"
|
||||||
|
onChange={(e, value) => setTab(value)}
|
||||||
|
textColor="primary"
|
||||||
|
indicatorColor="primary"
|
||||||
|
>
|
||||||
|
<Tab label={mint ? 'SPL' : 'SOL'} />
|
||||||
|
<Tab label="Wormhole" />
|
||||||
|
</Tabs>
|
||||||
|
) : (
|
||||||
|
tabs
|
||||||
|
)}
|
||||||
<DialogContent style={{ paddingTop: 16 }}>
|
<DialogContent style={{ paddingTop: 16 }}>
|
||||||
{tab === 0 ? (
|
{tab === 0 ? (
|
||||||
<>
|
<>
|
||||||
|
@ -142,6 +158,19 @@ export default function DepositDialog({
|
||||||
</Link>
|
</Link>
|
||||||
</DialogContentText>
|
</DialogContentText>
|
||||||
</>
|
</>
|
||||||
|
) : tab === 1 ? (
|
||||||
|
<DialogContentText>
|
||||||
|
Please use the{' '}
|
||||||
|
<a
|
||||||
|
href="https://www.portalbridge.com/#/transfer"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
style={{ color: 'white' }}
|
||||||
|
>
|
||||||
|
Wormhole Portal Bridge
|
||||||
|
</a>{' '}
|
||||||
|
to bridge your assets.
|
||||||
|
</DialogContentText>
|
||||||
) : (
|
) : (
|
||||||
<SolletSwapDepositAddress
|
<SolletSwapDepositAddress
|
||||||
balanceInfo={balanceInfo}
|
balanceInfo={balanceInfo}
|
||||||
|
|
|
@ -80,15 +80,24 @@ export default function SendDialog({ open, onClose, publicKey, balanceInfo }) {
|
||||||
const { mint, tokenName, tokenSymbol } = balanceInfo;
|
const { mint, tokenName, tokenSymbol } = balanceInfo;
|
||||||
|
|
||||||
const getTabs = (mint) => {
|
const getTabs = (mint) => {
|
||||||
|
// if sollet-private key not there, just show the SPL tab
|
||||||
|
if (!localStorage.getItem('sollet-private'))
|
||||||
|
return [
|
||||||
|
<Tab label={`SPL ${swapCoinInfo.ticker}`} key="spl" value="spl" />,
|
||||||
|
<Tab label={`Wormhole`} key="wormhole" value="wormhole" />,
|
||||||
|
];
|
||||||
|
|
||||||
if (mint?.equals(WUSDC_MINT)) {
|
if (mint?.equals(WUSDC_MINT)) {
|
||||||
return [
|
return [
|
||||||
<Tab label="SPL WUSDC" key="spl" value="spl" />,
|
<Tab label="SPL WUSDC" key="spl" value="spl" />,
|
||||||
|
<Tab label={`Wormhole`} key="wormhole" value="wormhole" />,
|
||||||
<Tab label="SPL USDC" key="wusdcToSplUsdc" value="wusdcToSplUsdc" />,
|
<Tab label="SPL USDC" key="wusdcToSplUsdc" value="wusdcToSplUsdc" />,
|
||||||
<Tab label="ERC20 USDC" key="swap" value="swap" />,
|
<Tab label="ERC20 USDC" key="swap" value="swap" />,
|
||||||
];
|
];
|
||||||
} else if (mint?.equals(WUSDT_MINT)) {
|
} else if (mint?.equals(WUSDT_MINT)) {
|
||||||
return [
|
return [
|
||||||
<Tab label="SPL WUSDT" key="spl" value="spl" />,
|
<Tab label="SPL WUSDT" key="spl" value="spl" />,
|
||||||
|
<Tab label={`Wormhole`} key="wormhole" value="wormhole" />,
|
||||||
<Tab label="SPL USDT" key="wusdtToSplUsdt" value="wusdtToSplUsdt" />,
|
<Tab label="SPL USDT" key="wusdtToSplUsdt" value="wusdtToSplUsdt" />,
|
||||||
<Tab label="ERC20 USDT" key="swap" value="swap" />,
|
<Tab label="ERC20 USDT" key="swap" value="swap" />,
|
||||||
];
|
];
|
||||||
|
@ -98,6 +107,7 @@ export default function SendDialog({ open, onClose, publicKey, balanceInfo }) {
|
||||||
) {
|
) {
|
||||||
return [
|
return [
|
||||||
<Tab label="SPL USDC" key="spl" value="spl" />,
|
<Tab label="SPL USDC" key="spl" value="spl" />,
|
||||||
|
<Tab label={`Wormhole`} key="wormhole" value="wormhole" />,
|
||||||
<Tab label="SPL WUSDC" key="usdcToSplWUsdc" value="usdcToSplWUsdc" />,
|
<Tab label="SPL WUSDC" key="usdcToSplWUsdc" value="usdcToSplWUsdc" />,
|
||||||
<Tab label="ERC20 USDC" key="swap" value="swap" />,
|
<Tab label="ERC20 USDC" key="swap" value="swap" />,
|
||||||
];
|
];
|
||||||
|
@ -113,6 +123,7 @@ export default function SendDialog({ open, onClose, publicKey, balanceInfo }) {
|
||||||
);
|
);
|
||||||
const tabs = [
|
const tabs = [
|
||||||
<Tab label={`SPL ${swapCoinInfo.ticker}`} key="spl" value="spl" />,
|
<Tab label={`SPL ${swapCoinInfo.ticker}`} key="spl" value="spl" />,
|
||||||
|
<Tab label={`Wormhole`} key="wormhole" value="wormhole" />,
|
||||||
];
|
];
|
||||||
if (
|
if (
|
||||||
!DISABLED_ERC20_MINTS.has(mint.toString()) ||
|
!DISABLED_ERC20_MINTS.has(mint.toString()) ||
|
||||||
|
@ -153,7 +164,18 @@ export default function SendDialog({ open, onClose, publicKey, balanceInfo }) {
|
||||||
>
|
>
|
||||||
{getTabs(mint)}
|
{getTabs(mint)}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
) : null}
|
) : (
|
||||||
|
<Tabs
|
||||||
|
value={tab}
|
||||||
|
variant="fullWidth"
|
||||||
|
onChange={(e, value) => setTab(value)}
|
||||||
|
textColor="primary"
|
||||||
|
indicatorColor="primary"
|
||||||
|
>
|
||||||
|
<Tab label="SPL" key="spl" value="spl" />
|
||||||
|
<Tab label={`Wormhole`} key="wormhole" value="wormhole" />
|
||||||
|
</Tabs>
|
||||||
|
)}
|
||||||
{tab === 'spl' ? (
|
{tab === 'spl' ? (
|
||||||
<SendSplDialog
|
<SendSplDialog
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
|
@ -161,6 +183,21 @@ export default function SendDialog({ open, onClose, publicKey, balanceInfo }) {
|
||||||
balanceInfo={balanceInfo}
|
balanceInfo={balanceInfo}
|
||||||
onSubmitRef={onSubmitRef}
|
onSubmitRef={onSubmitRef}
|
||||||
/>
|
/>
|
||||||
|
) : tab === 'wormhole' ? (
|
||||||
|
<DialogContent>
|
||||||
|
<DialogContentText>
|
||||||
|
Please use the{' '}
|
||||||
|
<a
|
||||||
|
href="https://www.portalbridge.com/#/transfer"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
style={{ color: 'white' }}
|
||||||
|
>
|
||||||
|
Wormhole Portal Bridge
|
||||||
|
</a>{' '}
|
||||||
|
to bridge your assets.
|
||||||
|
</DialogContentText>
|
||||||
|
</DialogContent>
|
||||||
) : tab === 'wusdcToSplUsdc' ? (
|
) : tab === 'wusdcToSplUsdc' ? (
|
||||||
<SendSwapDialog
|
<SendSwapDialog
|
||||||
key={tab}
|
key={tab}
|
||||||
|
|
Loading…
Reference in New Issue