Disable swap and deposits. Add deprecation notice

This commit is contained in:
Nathaniel Parke 2021-04-23 15:06:26 +08:00
parent abb6720a13
commit 60878e0daf
3 changed files with 79 additions and 44 deletions

View File

@ -6,6 +6,37 @@ import { Routes } from "./routes";
function App() {
return (
<div className="App">
<div className="Banner">
<div
className="Banner-description"
style={{
textAlign: 'left',
paddingLeft: '30px',
paddingTop: '5px'
}}
>
<strong>Swap is being deprecated.</strong>
<div
style={{
textAlign: 'left',
paddingLeft: '10px'
}}
>
<ul>
<li>
Removing liquidity is enabled through the My Pools tab
</li>
<li>
The Provide Liquidity and Swap functionalities have been disabled
</li>
<li>
For easy swapping using the on-chain Serum orderbook consider using
<a href={'https://raydium.io/swap/'} target="_blank" rel="noopener noreferrer"> raydium.io</a>
</li>
</ul>
</div>
</div>
</div>
<Routes />
<div className="social-buttons">
<GitHubButton

View File

@ -191,17 +191,18 @@ export const AddToLiquidity = () => {
className="add-button"
onClick={() => executeAction(pool)}
trigger={["click"]}
disabled={
connected &&
(depositType === "both"
? pendingTx ||
!A.account ||
!B.account ||
A.account === B.account ||
!hasSufficientBalance
: !getDepositToken()?.account ||
!getDepositToken()?.sufficientBalance())
}
// disabled={
// connected &&
// (depositType === "both"
// ? pendingTx ||
// !A.account ||
// !B.account ||
// A.account === B.account ||
// !hasSufficientBalance
// : !getDepositToken()?.account ||
// !getDepositToken()?.sufficientBalance())
// }
disabled={true}
type="primary"
size="large"
overlay={
@ -212,16 +213,17 @@ export const AddToLiquidity = () => {
/>
}
>
{depositType === "both"
? generateActionLabel(
pool ? ADD_LIQUIDITY_LABEL : CREATE_POOL_LABEL,
connected,
tokenMap,
A,
B
)
: generateExactOneLabel(connected, tokenMap, getDepositToken())}
{pendingTx && <Spin indicator={antIcon} className="add-spinner" />}
{/*{depositType === "both"*/}
{/* ? generateActionLabel(*/}
{/* pool ? ADD_LIQUIDITY_LABEL : CREATE_POOL_LABEL,*/}
{/* connected,*/}
{/* tokenMap,*/}
{/* A,*/}
{/* B*/}
{/* )*/}
{/* : generateExactOneLabel(connected, tokenMap, getDepositToken())}*/}
{/*{pendingTx && <Spin indicator={antIcon} className="add-spinner" />}*/}
Swap is being deprecated
</Dropdown.Button>
);

View File

@ -146,30 +146,32 @@ export const TradeEntry = () => {
size="large"
onClick={connected ? handleSwap : connect}
style={{ width: "100%" }}
disabled={
connected &&
(pendingTx ||
!A.account ||
!B.mintAddress ||
A.account === B.account ||
!A.sufficientBalance() ||
!pool)
}
disabled={true}
// disabled={
// connected &&
// (pendingTx ||
// !A.account ||
// !B.mintAddress ||
// A.account === B.account ||
// !A.sufficientBalance() ||
// !pool)
// }
>
{generateActionLabel(
!pool
? POOL_NOT_AVAILABLE(
getTokenName(tokenMap, A.mintAddress),
getTokenName(tokenMap, B.mintAddress)
)
: SWAP_LABEL,
connected,
tokenMap,
A,
B,
true
)}
{pendingTx && <Spin indicator={antIcon} className="add-spinner" />}
{/*{generateActionLabel(*/}
{/* !pool*/}
{/* ? POOL_NOT_AVAILABLE(*/}
{/* getTokenName(tokenMap, A.mintAddress),*/}
{/* getTokenName(tokenMap, B.mintAddress)*/}
{/* )*/}
{/* : SWAP_LABEL,*/}
{/* connected,*/}
{/* tokenMap,*/}
{/* A,*/}
{/* B,*/}
{/* true*/}
{/*)}*/}
{/*{pendingTx && <Spin indicator={antIcon} className="add-spinner" />}*/}
Swap is being deprecated
</Button>
<TradeInfo pool={pool} />
</>