Skip to content
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
43 changes: 37 additions & 6 deletions apps/cowswap-frontend/src/locales/en-US.po
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ msgstr "Unwrapping {amountStr} {wrapped} to {native}"
msgid "{symbolName} orders require a minimum transaction expiration time threshold of {minutes} minutes to ensure the best swapping experience."
msgstr "{symbolName} orders require a minimum transaction expiration time threshold of {minutes} minutes to ensure the best swapping experience."

#: apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalUnsupported.tsx
#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/AffiliateTradeCodeForm.tsx
msgid "You've been referred - here's your reward"
msgstr "You've been referred - here's your reward"

#: apps/cowswap-frontend/src/modules/tokensList/containers/SelectTokenWidget/hooks/useWidgetMetadata.ts
msgid "From network"
msgstr "From network"
Expand Down Expand Up @@ -1000,8 +1005,8 @@ msgstr "Enable Hooks"
#~ msgstr "Claim LlamaPay Vesting Hook"

#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/CodeLinkingSubtitle.tsx
msgid "Swap once to activate. Earn <0>{rewardAmount}</0> per <1>{triggerVolume}</1> of eligible volume over {timeCapDays} days. Rewards are paid out weekly to your Ethereum wallet."
msgstr "Swap once to activate. Earn <0>{rewardAmount}</0> per <1>{triggerVolume}</1> of eligible volume over {timeCapDays} days. Rewards are paid out weekly to your Ethereum wallet."
#~ msgid "Swap once to activate. Earn <0>{rewardAmount}</0> per <1>{triggerVolume}</1> of eligible volume over {timeCapDays} days. Rewards are paid out weekly to your Ethereum wallet."
#~ msgstr "Swap once to activate. Earn <0>{rewardAmount}</0> per <1>{triggerVolume}</1> of eligible volume over {timeCapDays} days. Rewards are paid out weekly to your Ethereum wallet."

#: apps/cowswap-frontend/src/modules/yield/containers/YieldWidget/index.tsx
msgid "Seamlessly swap your tokens into CoW AMM pools"
Expand All @@ -1020,6 +1025,10 @@ msgstr "Overview"
msgid "Loading operation"
msgstr "Loading operation"

#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/CodeLinkingSubtitle.tsx
msgid "Connect your wallet to activate it and start earning rewards when you trade."
msgstr "Connect your wallet to activate it and start earning rewards when you trade."

#: apps/cowswap-frontend/src/modules/affiliate/containers/AffiliatePartnerOnboard.tsx
#~ msgid "Share your referral code and earn <0>{partnerRewardAmount}</0> for every <1>{triggerVolumeLabel}</1> in eligible volume within {affiliateTimeCapDays} days.<2/><3/>"
#~ msgstr "Share your referral code and earn <0>{partnerRewardAmount}</0> for every <1>{triggerVolumeLabel}</1> in eligible volume within {affiliateTimeCapDays} days.<2/><3/>"
Expand Down Expand Up @@ -1196,6 +1205,10 @@ msgstr "Failed"
msgid "The amount of extra tokens you get on top of your limit price."
msgstr "The amount of extra tokens you get on top of your limit price."

#: apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalCodeLinking.tsx
msgid "Connect wallet to activate"
msgstr "Connect wallet to activate"

#: apps/cowswap-frontend/src/pages/games/MevSlicer/index.tsx
msgid "sandwich-icon"
msgstr "sandwich-icon"
Expand Down Expand Up @@ -1630,6 +1643,10 @@ msgstr "s"
msgid "Order Cancelled"
msgstr "Order Cancelled"

#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/CodeLinkingSubtitle.tsx
#~ msgid "Swap once to activate."
#~ msgstr "Swap once to activate."

#: apps/cowswap-frontend/src/modules/accountProxy/containers/InvalidCoWShedSetup/index.tsx
msgid "Please contact CoW Swap support!"
msgstr "Please contact CoW Swap support!"
Expand Down Expand Up @@ -2082,8 +2099,8 @@ msgid "Unknown"
msgstr "Unknown"

#: apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalCodeLinking.tsx
msgid "Connect to verify code"
msgstr "Connect to verify code"
#~ msgid "Connect to verify code"
#~ msgstr "Connect to verify code"

#: apps/cowswap-frontend/src/common/pure/AddressInputPanel/hooks/useReceiverPlaceholder.ts
msgid "Wallet Address or ENS name"
Expand Down Expand Up @@ -3504,6 +3521,10 @@ msgstr "Your order expired. This could be due to gas spikes, volatile prices, or
msgid "Not now"
msgstr "Not now"

#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/CodeLinkingSubtitle.tsx
msgid "Start earning rewards when you trade."
msgstr "Start earning rewards when you trade."

#: apps/cowswap-frontend/src/modules/ordersTable/pure/OrdersTable/Content/UnsupportedNetwork/OrdersTableUnsupportedNetworkContent.tsx
#: apps/cowswap-frontend/src/pages/Account/Tokens/TokensOverview.tsx
msgid "Unsupported network"
Expand Down Expand Up @@ -5421,9 +5442,7 @@ msgstr "Transaction {errorType}"
msgid "Price impact <0>unknown</0> - trade carefully"
msgstr "Price impact <0>unknown</0> - trade carefully"

#: apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderModalUnsupported.tsx
#: apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderOnboard.tsx
#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/AffiliateTradeCodeForm.tsx
msgid "Earn while you trade"
msgstr "Earn while you trade"

Expand Down Expand Up @@ -5802,6 +5821,10 @@ msgstr "Orders on CoW Swap can either be market orders (which fill at the market
msgid "at least"
msgstr "at least"

#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/CodeLinkingSubtitle.tsx
msgid "Earn <0>{rewardAmount}</0> per <1>{triggerVolume}</1> of eligible volume over {timeCapDays} days. Rewards are paid out weekly to your Ethereum wallet."
msgstr "Earn <0>{rewardAmount}</0> per <1>{triggerVolume}</1> of eligible volume over {timeCapDays} days. Rewards are paid out weekly to your Ethereum wallet."

#: apps/cowswap-frontend/src/modules/twap/utils/deadlinePartsDisplay.ts
msgid "m"
msgstr "m"
Expand Down Expand Up @@ -6460,6 +6483,10 @@ msgstr "Swap costs are at least {formattedFeePercentage}% of the swap amount"
msgid "Limit orders on CoW Swap capture surplus - so if the price moves in your favor, you're likely to get more than you asked for."
msgstr "Limit orders on CoW Swap capture surplus - so if the price moves in your favor, you're likely to get more than you asked for."

#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/CodeLinkingSubtitle.tsx
msgid "Your friend shared a referral code with you."
msgstr "Your friend shared a referral code with you."

#: apps/cowswap-frontend/src/modules/ordersTable/pure/ReceiptModal/ReceiptModal.modal.tsx
msgid "Avg. execution price"
msgstr "Avg. execution price"
Expand Down Expand Up @@ -6857,6 +6884,10 @@ msgstr "Connect signer"
msgid "Connect wallet banner"
msgstr "Connect wallet banner"

#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/CodeLinkingSubtitle.tsx
#~ msgid "Your friend shared a referral code with you. Connect your wallet to activate it and start earning rewards when you trade."
#~ msgstr "Your friend shared a referral code with you. Connect your wallet to activate it and start earning rewards when you trade."

#: apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/SettingsDropdown/SettingsDropdown.container.tsx
msgid "Enable Partial Approvals"
msgstr "Enable Partial Approvals"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function AffiliateTraderModalCodeLinking(): ReactNode {
const submitButtonLabel = useMemo(() => {
if (isVerifying) return t`Checking code...`
if (savedCode) return t`Start trading`
if (!account) return t`Connect to verify code`
if (!account) return t`Connect wallet to activate`
return t`Verify code`
}, [account, isVerifying, savedCode])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function AffiliateTraderModalUnsupported(): ReactNode {
<Body>
<img src={svgEarnAsTraderSrc} alt="" role="presentation" />
<Title>
<Trans>Earn while you trade</Trans>
<Trans>You&apos;ve been referred - here&apos;s your reward</Trans>
</Title>
<CodeLinkingSubtitle />
</Body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function useAffiliateTraderCodeInput(): UseAffiliateTraderCodeInputResult
useAffiliateTraderCodeFromUrl(onRecoveredFromUrl)

useEffect(() => {
if (shouldAutoVerify.current && !!account) {
if (shouldAutoVerify.current && !!account && !!codeInput) {
shouldAutoVerify.current = false
verifyCode(codeInput, account)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ export function AffiliateTradeCodeForm({
<Body>
<img src={svgEarnAsTraderSrc} alt="" role="presentation" />
<Title>
<Trans>Earn while you trade</Trans>
<Trans>You&apos;ve been referred - here&apos;s your reward</Trans>
</Title>
<CodeLinkingSubtitle codeInfo={codeInfo} />
<CodeLinkingSubtitle codeInfo={codeInfo} isWalletConnected={!!account} />
<LabelRow>
<Label htmlFor={referralCodeInputId}>
<LabelContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,26 @@ import { HowItWorks } from '../HowItWorks'

export interface CodeLinkingSubtitleProps {
codeInfo?: TraderInfoResponse | null
isWalletConnected?: boolean
}

export function CodeLinkingSubtitle(props: CodeLinkingSubtitleProps): ReactNode {
const { codeInfo } = props
const { codeInfo, isWalletConnected } = props
const rewardAmount = formatUsdcCompact(codeInfo?.traderRewardAmount ?? getDefaultTraderRewardAmount())
const triggerVolume = formatUsdCompact(codeInfo?.triggerVolume ?? getDefaultTriggerVolume())
const timeCapDays = codeInfo?.timeCapDays ?? PROGRAM_DEFAULTS.AFFILIATE_TIME_CAP_DAYS

return (
<Subtitle>
<Trans>Your friend shared a referral code with you.</Trans>{' '}
{isWalletConnected ? (
<Trans>Start earning rewards when you trade.</Trans>
) : (
<Trans>Connect your wallet to activate it and start earning rewards when you trade.</Trans>
)}{' '}
<Trans>
Swap once to activate. Earn <strong>{rewardAmount}</strong> per <strong>{triggerVolume}</strong> of eligible
volume over {timeCapDays} days. Rewards are paid out weekly to your Ethereum wallet.
Earn <strong>{rewardAmount}</strong> per <strong>{triggerVolume}</strong> of eligible volume over {timeCapDays}{' '}
days. Rewards are paid out weekly to your Ethereum wallet.
</Trans>{' '}
<HowItWorks />
</Subtitle>
Expand Down
Loading