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

Update review text based on chainId #2373

Merged
merged 1 commit into from
Feb 2, 2022
Merged
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
12 changes: 7 additions & 5 deletions src/custom/pages/Claim/InvestmentFlow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import RoundArrow from 'assets/cow-swap/round-arrow.svg'
import ImportantIcon from 'assets/cow-swap/important.svg'
import CowProtocolImage from 'assets/cow-swap/cowprotocol.svg'
import SVG from 'react-inlinesvg'
import { SupportedChainId } from 'constants/chains'

const STEPS_DATA = [
{
Expand All @@ -56,11 +57,12 @@ const STEPS_DATA = [
},
]

const FAQ_DATA = [
const FAQ_DATA = (chainId: number | undefined) => [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: why not passing directly the string? seems cleaner logic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is more flexible just in case there are some other changes in text based on chainId in the future.

{
title: 'What will happen?',
content:
'By sending this Ethereum transaction, you will be investing tokens from the connected account and exchanging them for vCOW tokens that will be received by the claiming account specified above.',
content: `By sending this ${
chainId !== SupportedChainId.XDAI ? 'Ethereum' : ''
} transaction, you will be investing tokens from the connected account and exchanging them for vCOW tokens that will be received by the claiming account specified above.`,
},
{
title: 'Can I modify (partially) invested amounts later?',
Expand Down Expand Up @@ -147,7 +149,7 @@ function AccountDetails({ isClaimer, label, account, connectedAccount }: Account
}

export default function InvestmentFlow({ claims, hasClaims, isAirdropOnly, modalCbs }: InvestmentFlowProps) {
const { account } = useActiveWeb3React()
const { account, chainId } = useActiveWeb3React()
const { selected, activeClaimAccount, claimStatus, isInvestFlowActive, investFlowStep, investFlowData } =
useClaimState()
const { initInvestFlowData } = useClaimDispatchers()
Expand Down Expand Up @@ -286,7 +288,7 @@ export default function InvestmentFlow({ claims, hasClaims, isAirdropOnly, modal
</AccountClaimSummary>

<h4>Ready to claim your vCOW?</h4>
<FaqDrawer items={FAQ_DATA} />
<FaqDrawer items={FAQ_DATA(chainId)} />
<UserMessage variant={'info'}>
<SVG src={ImportantIcon} description="Information" />
<span>
Expand Down