Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Disable claiming: BARN / PROD / ENS #2298

Merged
merged 2 commits into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/custom/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import Modal from 'components/Modal'
// import ClaimModal from 'components/claim/ClaimModal'
import UniBalanceContent from 'components/Header/UniBalanceContent'
import CowClaimButton from 'components/CowClaimButton'
import { IS_CLAIMING_ENABLED } from 'pages/Claim/const'

export const NETWORK_LABELS: { [chainId in ChainId]?: string } = {
[ChainId.RINKEBY]: 'Rinkeby',
Expand Down Expand Up @@ -258,9 +259,11 @@ export default function Header() {
<NetworkSelector />
</HeaderElement>
<HeaderElement>
<VCowWrapper>
<CowClaimButton isClaimPage={isClaimPage} account={account} handleOnClickClaim={handleOnClickClaim} />
</VCowWrapper>
{IS_CLAIMING_ENABLED && (
<VCowWrapper>
<CowClaimButton isClaimPage={isClaimPage} account={account} handleOnClickClaim={handleOnClickClaim} />
</VCowWrapper>
)}

<AccountElement active={!!account} style={{ pointerEvents: 'auto' }}>
{account && userEthBalance && (
Expand Down
3 changes: 2 additions & 1 deletion src/custom/pages/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { version } from '@src/../package.json'
import { environmentName } from 'utils/environments'
import { useFilterEmptyQueryParams } from 'hooks/useFilterEmptyQueryParams'
import RedirectAnySwapAffectedUsers from 'pages/error/AnySwapAffectedUsers/RedirectAnySwapAffectedUsers'
import { IS_CLAIMING_ENABLED } from 'pages/Claim/const'

const SENTRY_DSN = process.env.REACT_APP_SENTRY_DSN
const SENTRY_TRACES_SAMPLE_RATE = process.env.REACT_APP_SENTRY_TRACES_SAMPLE_RATE
Expand Down Expand Up @@ -75,7 +76,7 @@ export default function App() {
<Route exact strict path="/swap" component={Swap} />
<Route exact strict path="/swap/:outputCurrency" component={RedirectToSwap} />
<Route exact strict path="/send" component={RedirectPathToSwapOnly} />
<Route exact strict path="/claim" component={Claim} />
{IS_CLAIMING_ENABLED && <Route exact strict path="/claim" component={Claim} />}
<Route exact strict path="/about" component={About} />
<Route exact strict path="/profile" component={Profile} />
<Route exact strict path="/faq" component={Faq} />
Expand Down
3 changes: 3 additions & 0 deletions src/custom/pages/Claim/const.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { isProd, isEns, isBarn } from 'utils/environments'

export const IS_CLAIMING_ENABLED = !isProd && !isEns && !isBarn
4 changes: 4 additions & 0 deletions src/custom/pages/Claim/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@ import useTransactionConfirmationModal from 'hooks/useTransactionConfirmationMod
import { useErrorModal } from 'hooks/useErrorMessageAndModal'
import FooterNavButtons from './FooterNavButtons'

import { isProd, isEns, isBarn } from 'utils/environments'

/* TODO: Replace URLs with the actual final URL destinations */
export const COW_LINKS = {
vCowPost: 'https://cow.fi/',
stepGuide: 'https://cow.fi/',
}

export const IS_CLAIMING_ENABLED = !isProd && !isEns && !isBarn

export default function Claim() {
const { account } = useActiveWeb3React()

Expand Down
4 changes: 3 additions & 1 deletion src/custom/pages/Profile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import { useTokenBalance } from 'state/wallet/hooks'
import { V_COW } from 'constants/tokens'
import VCOWDropdown from './VCOWDropdown'

import { IS_CLAIMING_ENABLED } from 'pages/Claim/const'

export default function Profile() {
const referralLink = useReferralLink()
const { account, chainId } = useActiveWeb3React()
Expand Down Expand Up @@ -66,7 +68,7 @@ export default function Profile() {
<CardHead>
<Title>Profile</Title>
</CardHead>
{vCowBalance && <VCOWDropdown balance={vCowBalance} />}
{IS_CLAIMING_ENABLED && vCowBalance && <VCOWDropdown balance={vCowBalance} />}
</ProfileGridWrap>
</ProfileWrapper>
{chainId && chainId === ChainId.MAINNET && <AffiliateStatusCheck />}
Expand Down