swaps disabled message

This commit is contained in:
saml33 2023-04-14 09:40:20 +10:00
parent b09596322e
commit 17ea3b2be4
2 changed files with 20 additions and 12 deletions

View File

@ -438,9 +438,9 @@ const SwapForm = () => {
setShowConfirm={setShowConfirm} setShowConfirm={setShowConfirm}
amountIn={amountInAsDecimal} amountIn={amountInAsDecimal}
inputSymbol={inputBank?.name} inputSymbol={inputBank?.name}
amountOut={ // amountOut={
selectedRoute ? amountOutAsDecimal.toNumber() : undefined // selectedRoute ? amountOutAsDecimal.toNumber() : undefined
} // }
isDelegatedAccount={isDelegatedAccount} isDelegatedAccount={isDelegatedAccount}
/> />
) : ( ) : (
@ -507,7 +507,7 @@ export default SwapForm
const SwapFormSubmitButton = ({ const SwapFormSubmitButton = ({
amountIn, amountIn,
amountOut, // amountOut,
inputSymbol, inputSymbol,
loadingSwapDetails, loadingSwapDetails,
selectedRoute, selectedRoute,
@ -516,7 +516,7 @@ const SwapFormSubmitButton = ({
isDelegatedAccount, isDelegatedAccount,
}: { }: {
amountIn: Decimal amountIn: Decimal
amountOut: number | undefined // amountOut: number | undefined
inputSymbol: string | undefined inputSymbol: string | undefined
loadingSwapDetails: boolean loadingSwapDetails: boolean
selectedRoute: RouteInfo | undefined | null selectedRoute: RouteInfo | undefined | null
@ -533,12 +533,12 @@ const SwapFormSubmitButton = ({
? amountWithBorrow.lt(amountIn) ? amountWithBorrow.lt(amountIn)
: tokenMax.lt(amountIn) : tokenMax.lt(amountIn)
const disabled = // const disabled =
connected && // connected &&
(!amountIn.toNumber() || // (!amountIn.toNumber() ||
showInsufficientBalance || // showInsufficientBalance ||
!amountOut || // !amountOut ||
!selectedRoute) // !selectedRoute)
const onClick = connected ? () => setShowConfirm(true) : handleConnect const onClick = connected ? () => setShowConfirm(true) : handleConnect
@ -547,7 +547,8 @@ const SwapFormSubmitButton = ({
<Button <Button
onClick={onClick} onClick={onClick}
className="mt-6 mb-4 flex w-full items-center justify-center text-base" className="mt-6 mb-4 flex w-full items-center justify-center text-base"
disabled={disabled} // disabled={disabled}
disabled={true}
size="large" size="large"
> >
{isDelegatedAccount ? ( {isDelegatedAccount ? (

View File

@ -7,6 +7,7 @@ import dynamic from 'next/dynamic'
import SwapIntroModal from '@components/modals/SwapIntroModal' import SwapIntroModal from '@components/modals/SwapIntroModal'
import { useLocalStorage } from '@solana/wallet-adapter-react' import { useLocalStorage } from '@solana/wallet-adapter-react'
import { SHOW_SWAP_INTRO_MODAL } from 'utils/constants' import { SHOW_SWAP_INTRO_MODAL } from 'utils/constants'
import { ExclamationTriangleIcon } from '@heroicons/react/20/solid'
// import useLocalStorageState from 'hooks/useLocalStorageState' // import useLocalStorageState from 'hooks/useLocalStorageState'
// import { IS_ONBOARDED_KEY } from 'utils/constants' // import { IS_ONBOARDED_KEY } from 'utils/constants'
const SwapTokenChart = dynamic(() => import('./SwapTokenChart'), { ssr: false }) const SwapTokenChart = dynamic(() => import('./SwapTokenChart'), { ssr: false })
@ -22,6 +23,12 @@ const SwapPage = () => {
return ( return (
<> <>
<div className="flex items-center justify-center bg-th-down-muted py-2 px-6">
<ExclamationTriangleIcon className="mr-1.5 h-4 w-4 flex-shrink-0 text-white" />
<span className="leading-tight text-white">
Swaps are currently disabled. A progam update is required.
</span>
</div>
<div className="grid grid-cols-12"> <div className="grid grid-cols-12">
<div className="col-span-12 border-th-bkg-3 md:col-span-6 md:border-b lg:col-span-7 xl:col-span-8"> <div className="col-span-12 border-th-bkg-3 md:col-span-6 md:border-b lg:col-span-7 xl:col-span-8">
<SwapTokenChart /> <SwapTokenChart />