Skip to content

Commit

Permalink
Merge pull request #334 from skalenetwork/disable-onramp-page
Browse files Browse the repository at this point in the history
Add DISABLE_TRANSAK option
  • Loading branch information
dmytrotkk authored Aug 19, 2024
2 parents 860dd6e + 40c120c commit 73e5b7c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/core/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const BALANCE_UPDATE_INTERVAL_MS = _BALANCE_UPDATE_INTERVAL_SECONDS * 100

export const TRANSAK_STAGING_ENV = import.meta.env.VITE_TRANSAK_STAGING_ENV === 'true'
export const TRANSAK_API_KEY = import.meta.env.VITE_TRANSAK_API_KEY
export const DISABLE_TRANSAK = import.meta.env.VITE_DISABLE_TRANSAK === 'true'

export const DAPP_RADAR_BASE_URL = 'https://dappradar.com/dapp/'

Expand Down
20 changes: 19 additions & 1 deletion src/pages/Onramp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ import TokenBalanceTile from '../components/TokenBalanceTile'
import ConnectWallet from '../components/ConnectWallet'
import Message from '../components/Message'
import { getPaymasterChain } from '../core/paymaster'
import { MAINNET_CHAIN_NAME, TRANSAK_STAGING_ENV, TRANSAK_API_KEY } from '../core/constants'
import {
MAINNET_CHAIN_NAME,
TRANSAK_STAGING_ENV,
TRANSAK_API_KEY,
DISABLE_TRANSAK
} from '../core/constants'
import Tile from '../components/Tile'

const MOUNT_ID = 'transakMount'
Expand All @@ -52,6 +57,19 @@ export default function Onramp(props: { mpc: MetaportCore }) {
const chain = getPaymasterChain(props.mpc.config.skaleNetwork)
const isProd = props.mpc.config.skaleNetwork === MAINNET_CHAIN_NAME && !TRANSAK_STAGING_ENV

if (DISABLE_TRANSAK)
return (
<Container maxWidth="md">
<Tile
value="The SKALE On-ramp is currently unavailable for maintenance."
text="Temporary unavailable"
icon={<ErrorRoundedIcon />}
color="warning"
className={cls(cmn.mtop20)}
/>
</Container>
)

if (!chain)
return (
<Container maxWidth="sm">
Expand Down

0 comments on commit 73e5b7c

Please sign in to comment.