Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(earn): update cta description #5394

Merged
merged 1 commit into from
May 7, 2024
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
10 changes: 6 additions & 4 deletions locales/base/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -2326,9 +2326,11 @@
}
}
},
"earnStablecoin": {
"title": "Earn on your stablecoins",
"subtitle": "Deposit today and earn returns",
"description": "If you deposit <0></0>, you can get up to <1></1> at the end of the year!"
"earnFlow": {
"cta": {
"title": "Earn on your stablecoins",
"subtitle": "Deposit today and earn returns",
"description": "See how much you can earn when supplying a lending pool"
}
}
}
8 changes: 3 additions & 5 deletions src/earn/EarnCta.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ describe('EarnCta', () => {
</Provider>
)

expect(getByText('earnStablecoin.title')).toBeTruthy()
expect(getByText('earnStablecoin.subtitle')).toBeTruthy()
expect(getByTestId('EarnCta/Description')).toHaveTextContent(
'earnStablecoin.description10.00 USDC₱1.33'
)
expect(getByText('earnFlow.cta.title')).toBeTruthy()
expect(getByText('earnFlow.cta.subtitle')).toBeTruthy()
expect(getByText('earnFlow.cta.subtitle')).toBeTruthy()

fireEvent.press(getByTestId('EarnCta'))
expect(ValoraAnalytics.track).toHaveBeenCalledWith(EarnEvents.earn_cta_press)
Expand Down
20 changes: 4 additions & 16 deletions src/earn/EarnCta.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import React from 'react'
import { Trans, useTranslation } from 'react-i18next'
import { useTranslation } from 'react-i18next'
import { StyleSheet, Text, View } from 'react-native'
import { EarnEvents } from 'src/analytics/Events'
import ValoraAnalytics from 'src/analytics/ValoraAnalytics'
import TokenDisplay from 'src/components/TokenDisplay'
import Touchable from 'src/components/Touchable'
import EarnAave from 'src/icons/EarnAave'
import Colors from 'src/styles/colors'
import { typeScale } from 'src/styles/fonts'
import { Spacing } from 'src/styles/styles'
import networkConfig from 'src/web3/networkConfig'

export default function EarnCta() {
const { t } = useTranslation()
Expand All @@ -23,22 +21,12 @@ export default function EarnCta() {
testID="EarnCta"
>
<>
<Text style={styles.title}>{t('earnStablecoin.title')}</Text>
<Text style={styles.title}>{t('earnFlow.cta.title')}</Text>
<View style={styles.row}>
<EarnAave />
<View style={styles.subtitleContainer}>
<Text style={styles.subtitle}>{t('earnStablecoin.subtitle')}</Text>
<Text style={styles.description} testID="EarnCta/Description">
<Trans i18nKey="earnStablecoin.description">
{/* TODO(ACT-1174): use the right amounts here */}
<TokenDisplay
amount={10}
tokenId={networkConfig.arbUsdcTokenId}
showLocalAmount={false}
/>
<TokenDisplay amount={1} tokenId={networkConfig.arbUsdcTokenId} />
</Trans>
</Text>
<Text style={styles.subtitle}>{t('earnFlow.cta.subtitle')}</Text>
<Text style={styles.description}>{t('earnFlow.cta.description')}</Text>
</View>
</View>
</>
Expand Down
Loading