Skip to content

✨ Improve Merit tooltip #2389

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions public/icons/other/aci.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 32 additions & 15 deletions src/components/incentives/MeritIncentivesTooltipContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@ export const MeritIncentivesTooltipContent = ({
justifyContent: 'center',
alignItems: 'start',
flexDirection: 'column',
gap: '10px',
}}
>
<Typography variant="caption" color="text.primary" mb={3}>
<img src={`/icons/other/aci.svg`} width="100px" height="40px" alt="" />

<Typography variant="caption" color="text.primary" fontSize={13}>
<Trans>Eligible for the Merit program.</Trans>
</Typography>

<Typography variant="caption" color="text.secondary" mb={3}>
<Typography variant="caption" color="text.secondary">
<Trans>
This is a program initiated and implemented by the decentralised Aave community. Aave Labs
This is a program initiated and implemented by the Aave Chan Initiative (ACI). Aave Labs
does not guarantee the program and accepts no liability.
</Trans>{' '}
<Link
Expand All @@ -49,23 +52,37 @@ export const MeritIncentivesTooltipContent = ({
</Link>
</Typography>

<Typography variant="caption" color="text.secondary" mb={3}>
<Trans>Merit Program rewards are claimed through the</Trans>{' '}
{meritIncentives.customMessage ? (
<Typography variant="caption" color="text.primary">
<Trans>{meritIncentives.customMessage}</Trans>
</Typography>
) : null}

<Typography variant="caption" color="text.strong" fontSize={13} fontWeight={'600'}>
<Trans>Merit Program rewards are claimed through the</Trans>
<Link
href="https://apps.aavechan.com/merit"
sx={{ textDecoration: 'underline' }}
href={`https://apps.aavechan.com/merit/${meritIncentives.action}`}
sx={{ textDecoration: 'underline', ml: 1 }}
variant="caption"
color="text.secondary"
>
Aave Chan Initiative interface
<span
style={{
fontSize: '13px',
fontWeight: '600',
}}
>
{'Aave Chan Initiative interface'}
</span>
</Link>
{'.'}
<span
style={{
fontSize: '13px',
fontWeight: '600',
}}
>
{'.'}
</span>
</Typography>
{meritIncentives.customMessage ? (
<Typography variant="caption" color="text.strong" mb={3}>
<Trans>{meritIncentives.customMessage}</Trans>
</Typography>
) : null}

<Box sx={{ width: '100%' }}>
<Row
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Trans } from '@lingui/macro';
import { Box, Typography } from '@mui/material';
import { ExtendedReserveIncentiveResponse } from 'src/hooks/useMeritIncentives';
import { ExtendedReserveIncentiveResponse } from 'src/hooks/useZkSyncIgniteIncentives';

import { FormattedNumber } from '../primitives/FormattedNumber';
import { Link } from '../primitives/Link';
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/useMeritIncentives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type MeritIncentives = {
};

export type ExtendedReserveIncentiveResponse = ReserveIncentiveResponse & {
action: MeritAction;
customMessage: string;
customForumLink: string;
};
Expand All @@ -51,9 +52,9 @@ const url = 'https://apps.aavechan.com/api/merit/aprs';

export type MeritReserveIncentiveData = Omit<ReserveIncentiveResponse, 'incentiveAPR'> & {
action: MeritAction;
protocolAction?: ProtocolAction;
customMessage?: string;
customForumLink?: string;
protocolAction?: ProtocolAction;
};

const getMeritData = (market: string, symbol: string): MeritReserveIncentiveData[] | undefined =>
Expand Down Expand Up @@ -348,6 +349,7 @@ export const useMeritIncentives = ({
incentiveAPR: (APR / 100).toString(),
rewardTokenAddress: incentive.rewardTokenAddress,
rewardTokenSymbol: incentive.rewardTokenSymbol,
action: incentive.action,
customMessage: incentive.customMessage,
customForumLink: incentive.customForumLink,
} as ExtendedReserveIncentiveResponse;
Expand Down
2 changes: 1 addition & 1 deletion src/locales/el/messages.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/locales/en/messages.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -978,10 +978,6 @@ msgstr "Rewards can be claimed through"
msgid "This is a program initiated and implemented by the decentralised ZKSync community. Aave Labs does not guarantee the program and accepts no liability."
msgstr "This is a program initiated and implemented by the decentralised ZKSync community. Aave Labs does not guarantee the program and accepts no liability."

#: src/components/incentives/MeritIncentivesTooltipContent.tsx
msgid "This is a program initiated and implemented by the decentralised Aave community. Aave Labs does not guarantee the program and accepts no liability."
msgstr "This is a program initiated and implemented by the decentralised Aave community. Aave Labs does not guarantee the program and accepts no liability."

#: pages/500.page.tsx
msgid "Sorry, an unexpected error happened. In the meantime you may try reloading the page, or come back later."
msgstr "Sorry, an unexpected error happened. In the meantime you may try reloading the page, or come back later."
Expand Down Expand Up @@ -1985,6 +1981,10 @@ msgstr "Addresses"
msgid "The requested amount is greater than the max loan size in stable rate mode"
msgstr "The requested amount is greater than the max loan size in stable rate mode"

#: src/components/incentives/MeritIncentivesTooltipContent.tsx
msgid "This is a program initiated and implemented by the Aave Chan Initiative (ACI). Aave Labs does not guarantee the program and accepts no liability."
msgstr "This is a program initiated and implemented by the Aave Chan Initiative (ACI). Aave Labs does not guarantee the program and accepts no liability."

#: pages/index.page.tsx
#: src/components/transactions/Supply/SupplyModal.tsx
#: src/modules/dashboard/lists/SuppliedPositionsList/SuppliedPositionsListItem.tsx
Expand Down
2 changes: 1 addition & 1 deletion src/locales/es/messages.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/locales/fr/messages.js

Large diffs are not rendered by default.