@@ -2,6 +2,7 @@ import { Trans } from '@lingui/macro';
22import { Box , Typography , useTheme } from '@mui/material' ;
33import {
44 ExtendedReserveIncentiveResponse ,
5+ MeritAction ,
56 MeritIncentivesBreakdown ,
67} from 'src/hooks/useMeritIncentives' ;
78
@@ -11,17 +12,66 @@ import { Row } from '../primitives/Row';
1112import { TokenIcon } from '../primitives/TokenIcon' ;
1213import { 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+
1464export 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 >
0 commit comments