Skip to content

Commit 44d7a1d

Browse files
authored
feat: update tooltip celo for supply usdt (#2585)
1 parent aa30a40 commit 44d7a1d

File tree

6 files changed

+109
-11
lines changed

6 files changed

+109
-11
lines changed

src/components/incentives/MeritIncentivesTooltipContent.tsx

Lines changed: 96 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Trans } from '@lingui/macro';
22
import { Box, Typography, useTheme } from '@mui/material';
33
import {
44
ExtendedReserveIncentiveResponse,
5+
MeritAction,
56
MeritIncentivesBreakdown,
67
} from 'src/hooks/useMeritIncentives';
78

@@ -11,17 +12,66 @@ import { Row } from '../primitives/Row';
1112
import { TokenIcon } from '../primitives/TokenIcon';
1213
import { getSymbolMap } from './IncentivesTooltipContent';
1314

15+
export enum CampaignType {
16+
SELF_VERIFICATION = 'self_verification',
17+
CELO_STANDARD = 'celo_standard',
18+
STANDARD = 'standard',
19+
}
20+
interface CampaignConfig {
21+
type: CampaignType;
22+
title: string;
23+
hasSpecialContent: boolean;
24+
}
25+
26+
const isCeloAction = (action: MeritAction): boolean => {
27+
return [
28+
MeritAction.CELO_SUPPLY_CELO,
29+
MeritAction.CELO_SUPPLY_USDT,
30+
MeritAction.CELO_SUPPLY_USDC,
31+
MeritAction.CELO_SUPPLY_WETH,
32+
MeritAction.CELO_SUPPLY_MULTIPLE_BORROW_USDT,
33+
MeritAction.CELO_BORROW_CELO,
34+
MeritAction.CELO_BORROW_USDT,
35+
MeritAction.CELO_BORROW_USDC,
36+
MeritAction.CELO_BORROW_WETH,
37+
].includes(action);
38+
};
39+
const isSelfVerificationCampaign = (action: MeritAction): boolean =>
40+
action === MeritAction.CELO_SUPPLY_USDT;
41+
42+
const getCampaignConfig = (action: MeritAction): CampaignConfig => {
43+
if (isSelfVerificationCampaign(action)) {
44+
return {
45+
type: CampaignType.SELF_VERIFICATION,
46+
title: 'Eligible for Merit program and Boosted Yield via Self.',
47+
hasSpecialContent: true,
48+
};
49+
}
50+
if (isCeloAction(action)) {
51+
return {
52+
type: CampaignType.CELO_STANDARD,
53+
title: 'Eligible for Merit program.',
54+
hasSpecialContent: true,
55+
};
56+
}
57+
return {
58+
type: CampaignType.STANDARD,
59+
title: 'Eligible for the Merit program.',
60+
hasSpecialContent: false,
61+
};
62+
};
63+
1464
export const MeritIncentivesTooltipContent = ({
1565
meritIncentives,
1666
}: {
1767
meritIncentives: ExtendedReserveIncentiveResponse & { breakdown?: MeritIncentivesBreakdown };
1868
}) => {
1969
const theme = useTheme();
20-
2170
const typographyVariant = 'secondary12';
22-
2371
const meritIncentivesFormatted = getSymbolMap(meritIncentives);
2472

73+
const campaignConfig = getCampaignConfig(meritIncentives.action);
74+
2575
return (
2676
<Box
2777
sx={{
@@ -44,7 +94,7 @@ export const MeritIncentivesTooltipContent = ({
4494
/>
4595

4696
<Typography variant="caption" color="text.primary" fontSize={13}>
47-
<Trans>Eligible for the Merit program.</Trans>
97+
<Trans>{campaignConfig.title}</Trans>
4898
</Typography>
4999

50100
<Typography variant="caption" color="text.secondary">
@@ -66,6 +116,49 @@ export const MeritIncentivesTooltipContent = ({
66116
</Link>
67117
</Typography>
68118

119+
{campaignConfig.type === CampaignType.SELF_VERIFICATION && (
120+
<>
121+
<Typography variant="caption" color="text.secondary">
122+
<Trans>
123+
Supply USDT and double your yield by{' '}
124+
<span>
125+
<Link
126+
href="https://aave.self.xyz/"
127+
sx={{ textDecoration: 'underline' }}
128+
variant="caption"
129+
color="text.secondary"
130+
>
131+
verifying your humanity through Self
132+
</Link>
133+
</span>{' '}
134+
for the first $1,000 USDT supplied per user.
135+
</Trans>{' '}
136+
</Typography>
137+
<Typography variant="caption" color="text.secondary">
138+
<Trans>
139+
Visit{' '}
140+
<span>
141+
<Link
142+
href="https://aave.self.xyz/"
143+
sx={{ textDecoration: 'underline' }}
144+
variant="caption"
145+
color="text.secondary"
146+
>
147+
https://aave.self.xyz/
148+
</Link>
149+
</span>{' '}
150+
to get started with Self’s ZK-powered proof-of-humanity authentication.
151+
</Trans>{' '}
152+
</Typography>
153+
</>
154+
)}
155+
{/* Show if SpecialContent is needed */}
156+
{/* {campaignConfig.type === CampaignType.SELF_VERIFICATION &&
157+
campaignConfig.hasSpecialContent &&
158+
''} */}
159+
{/* Show if SpecialContent is needed */}
160+
{/* {campaignConfig.type === CampaignType.CELO_STANDARD && campaignConfig.hasSpecialContent && ''} */}
161+
69162
{meritIncentives.customMessage ? (
70163
<Typography variant="caption" color="text.secondary">
71164
<Trans>{meritIncentives.customMessage}</Trans>

src/locales/el/messages.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/locales/en/messages.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/locales/en/messages.po

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,7 @@ msgstr "I confirm the swap with a potential {0}% value loss"
11781178
msgid "deposited"
11791179
msgstr "deposited"
11801180

1181+
#: src/components/incentives/MeritIncentivesTooltipContent.tsx
11811182
#: src/components/incentives/MeritIncentivesTooltipContent.tsx
11821183
#: src/components/incentives/MerklIncentivesTooltipContent.tsx
11831184
#: src/components/incentives/MerklIncentivesTooltipContent.tsx
@@ -1270,6 +1271,10 @@ msgstr "Wallet balance"
12701271
msgid "Borrow balance after repay"
12711272
msgstr "Borrow balance after repay"
12721273

1274+
#: src/components/incentives/MeritIncentivesTooltipContent.tsx
1275+
msgid "Supply USDT and double your yield by <0><1>verifying your humanity through Self</1></0> for the first $1,000 USDT supplied per user."
1276+
msgstr "Supply USDT and double your yield by <0><1>verifying your humanity through Self</1></0> for the first $1,000 USDT supplied per user."
1277+
12731278
#: src/modules/migration/MigrationLists.tsx
12741279
msgid "Supplied assets"
12751280
msgstr "Supplied assets"
@@ -1695,6 +1700,10 @@ msgstr "There are no stake assets configured for this market"
16951700
msgid "Proposal details"
16961701
msgstr "Proposal details"
16971702

1703+
#: src/components/incentives/MeritIncentivesTooltipContent.tsx
1704+
msgid "Visit <0><1>https://aave.self.xyz/</1></0> to get started with Self’s ZK-powered proof-of-humanity authentication."
1705+
msgstr "Visit <0><1>https://aave.self.xyz/</1></0> to get started with Self’s ZK-powered proof-of-humanity authentication."
1706+
16981707
#: src/ui-config/errorMapping.tsx
16991708
msgid "Asset is not listed"
17001709
msgstr "Asset is not listed"
@@ -2185,10 +2194,6 @@ msgstr "Borrow APY, variable"
21852194
msgid "This asset is eligible for rewards through SuperFest. Aave Labs does not guarantee the program and accepts no liability."
21862195
msgstr "This asset is eligible for rewards through SuperFest. Aave Labs does not guarantee the program and accepts no liability."
21872196

2188-
#: src/components/incentives/MeritIncentivesTooltipContent.tsx
2189-
msgid "Eligible for the Merit program."
2190-
msgstr "Eligible for the Merit program."
2191-
21922197
#: src/components/Warnings/CooldownWarning.tsx
21932198
msgid "Cooldown period warning"
21942199
msgstr "Cooldown period warning"

src/locales/es/messages.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/locales/fr/messages.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)