Skip to content

Commit

Permalink
chore: gov community program (#1974)
Browse files Browse the repository at this point in the history
  • Loading branch information
foodaka authored Mar 6, 2024
1 parent ca17c74 commit 5476dd9
Show file tree
Hide file tree
Showing 9 changed files with 232 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/locales/en/messages.js

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,21 @@ msgstr "Effective interest rate"
msgid "Efficiency mode (E-Mode)"
msgstr "Efficiency mode (E-Mode)"

#: src/modules/markets/MarketAssetsListItem.tsx
msgid "Eligible for <0>2.1M$</0> WETH Community Program 👻"
msgstr "Eligible for <0>2.1M$</0> WETH Community Program 👻"

#: src/modules/dashboard/lists/BorrowAssetsList/BorrowAssetsListItem.tsx
#: src/modules/dashboard/lists/BorrowAssetsList/BorrowAssetsListMobileItem.tsx
#: src/modules/markets/MarketAssetsListMobileItem.tsx
msgid "Eligible for <0>2.1M$</0> wETH Community Program 👻"
msgstr "Eligible for <0>2.1M$</0> wETH Community Program 👻"

#: src/modules/dashboard/lists/BorrowAssetsList/GhoBorrowAssetsListItem.tsx
#: src/modules/markets/Gho/GhoBanner.tsx
msgid "Eligible for <0>2.9M$</0> GHO Community Program 👻"
msgstr "Eligible for <0>2.9M$</0> GHO Community Program 👻"

#: src/components/transactions/Emode/EmodeModalContent.tsx
msgid "Emode"
msgstr "Emode"
Expand Down Expand Up @@ -2606,6 +2621,15 @@ msgstr "This gas calculation is only an estimation. Your wallet will set the pri
msgid "This integration was<0>proposed and approved</0>by the community."
msgstr "This integration was<0>proposed and approved</0>by the community."

#: src/modules/dashboard/lists/BorrowAssetsList/BorrowAssetsListItem.tsx
#: src/modules/dashboard/lists/BorrowAssetsList/BorrowAssetsListMobileItem.tsx
#: src/modules/dashboard/lists/BorrowAssetsList/GhoBorrowAssetsListItem.tsx
#: src/modules/markets/Gho/GhoBanner.tsx
#: src/modules/markets/MarketAssetsListItem.tsx
#: src/modules/markets/MarketAssetsListMobileItem.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."

#: src/components/infoTooltips/AvailableTooltip.tsx
msgid "This is the total amount available for you to borrow. You can borrow based on your collateral and until the borrow cap is reached."
msgstr "This is the total amount available for you to borrow. You can borrow based on your collateral and until the borrow cap is reached."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Trans } from '@lingui/macro';
import { Button } from '@mui/material';
import { Button, Typography } from '@mui/material';
import { TextWithTooltip } from 'src/components/TextWithTooltip';
import { useModalContext } from 'src/hooks/useModal';
import { useProtocolDataContext } from 'src/hooks/useProtocolDataContext';
import { useRootStore } from 'src/store/root';
import { DashboardReserve } from 'src/utils/dashboardSortUtils';
import { DASHBOARD } from 'src/utils/mixPanelEvents';
import { DASHBOARD, GENERAL } from 'src/utils/mixPanelEvents';

import { CapsHint } from '../../../../components/caps/CapsHint';
import { CapType } from '../../../../components/caps/helper';
Expand Down Expand Up @@ -33,6 +34,7 @@ export const BorrowAssetsListItem = ({
const disableBorrow = isFreezed || Number(availableBorrows) <= 0;

const trackEvent = useRootStore((store) => store.trackEvent);
console.log('currentMarket', currentMarket);

return (
<ListItemWrapper
Expand Down Expand Up @@ -62,7 +64,36 @@ export const BorrowAssetsListItem = ({
value={Number(variableBorrowRate)}
incentives={vIncentivesData}
symbol={symbol}
/>
>
{symbol === 'ETH' && currentMarket === 'proto_mainnet_v3' && (
<Link
href="https://governance.aave.com/t/arfc-merit-a-new-aave-alignment-user-reward-system/16646"
style={{ textDecoration: 'none', color: 'inherit', textAlign: 'center' }}
target="blank"
>
<Typography variant="secondary14">
<Trans>
Eligible for <strong>2.1M$</strong> wETH Community Program 👻
</Trans>
<TextWithTooltip
wrapperProps={{ sx: { display: 'inline-flex', alignItems: 'center' } }}
event={{
eventName: GENERAL.TOOL_TIP,
eventParams: {
tooltip: 'Community Rewards',
},
}}
>
<Trans>
This is a program initiated and implemented by the decentralised Aave community.
Aave Labs does not guarantee the program and accepts no liability.
</Trans>
</TextWithTooltip>
</Typography>
</Link>
)}
</ListAPRColumn>

{/* <ListAPRColumn
value={Number(stableBorrowRate)}
incentives={sIncentivesData}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Trans } from '@lingui/macro';
import { Box, Button } from '@mui/material';
import { Box, Button, Typography } from '@mui/material';
import { VariableAPYTooltip } from 'src/components/infoTooltips/VariableAPYTooltip';
import { TextWithTooltip } from 'src/components/TextWithTooltip';
import { useProtocolDataContext } from 'src/hooks/useProtocolDataContext';
import { DashboardReserve } from 'src/utils/dashboardSortUtils';
import { GENERAL } from 'src/utils/mixPanelEvents';

import { CapsHint } from '../../../../components/caps/CapsHint';
import { CapType } from '../../../../components/caps/helper';
Expand Down Expand Up @@ -53,7 +55,6 @@ export const BorrowAssetsListMobileItem = ({
/>
}
/>

<Row
caption={
<VariableAPYTooltip
Expand All @@ -73,7 +74,6 @@ export const BorrowAssetsListMobileItem = ({
variant="secondary14"
/>
</Row>

{/* <Row
caption={
<StableAPYTooltip
Expand All @@ -93,7 +93,35 @@ export const BorrowAssetsListMobileItem = ({
variant="secondary14"
/>
</Row> */}

{symbol === 'ETH' && currentMarket === 'proto_mainnet_v3' && (
<Row>
<Link
href="https://governance.aave.com/t/arfc-merit-a-new-aave-alignment-user-reward-system/16646"
style={{ textDecoration: 'none', color: 'inherit', textAlign: 'center' }}
target="blank"
>
<Typography variant="description">
<Trans>
Eligible for <strong>2.1M$</strong> wETH Community Program 👻
</Trans>
<TextWithTooltip
wrapperProps={{ sx: { display: 'inline-flex', alignItems: 'center' } }}
event={{
eventName: GENERAL.TOOL_TIP,
eventParams: {
tooltip: 'Community Rewards',
},
}}
>
<Trans>
This is a program initiated and implemented by the decentralised Aave community.
Aave Labs does not guarantee the program and accepts no liability.
</Trans>
</TextWithTooltip>
</Typography>
</Link>
</Row>
)}
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mt: 5 }}>
<Button
disabled={disableBorrow}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import { CustomMarket } from 'src/ui-config/marketsConfig';
import { DASHBOARD_LIST_COLUMN_WIDTHS } from 'src/utils/dashboardSortUtils';
import { getMaxGhoMintAmount } from 'src/utils/getMaxAmountAvailableToBorrow';
import { weightedAverageAPY } from 'src/utils/ghoUtilities';

import { GENERAL } from 'src/utils/mixPanelEvents';
import { TextWithTooltip } from 'src/components/TextWithTooltip';
import { Link, ROUTES } from '../../../../components/primitives/Link';
import { ListButtonsColumn } from '../ListButtonsColumn';
import { ListMobileItemWrapper } from '../ListMobileItemWrapper';
Expand Down Expand Up @@ -177,6 +178,31 @@ const GhoBorrowAssetsListItemDesktop = ({
forceShowTooltip
userQualifiesForDiscount
/>
<Link
href="https://governance.aave.com/t/arfc-merit-a-new-aave-alignment-user-reward-system/16646"
style={{ textDecoration: 'none', color: 'inherit', textAlign: 'center' }}
target="blank"
>
<Typography variant="secondary14">
<Trans>
Eligible for <strong>2.9M$</strong> GHO Community Program 👻
</Trans>
<TextWithTooltip
wrapperProps={{ sx: { display: 'inline-flex', alignItems: 'center' } }}
event={{
eventName: GENERAL.TOOL_TIP,
eventParams: {
tooltip: 'Community Rewards',
},
}}
>
<Trans>
This is a program initiated and implemented by the decentralised Aave community.
Aave Labs does not guarantee the program and accepts no liability.
</Trans>
</TextWithTooltip>
</Typography>
</Link>
</ListColumn>
<ListButtonsColumn>
<Button disabled={borrowButtonDisable} variant="contained" onClick={onBorrowClick}>
Expand Down
10 changes: 9 additions & 1 deletion src/modules/dashboard/lists/ListAPRColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,23 @@ interface ListAPRColumnProps {
incentives?: ReserveIncentiveResponse[];
symbol: string;
tooltip?: ReactNode;
children?: ReactNode;
}

export const ListAPRColumn = ({ value, incentives, symbol, tooltip }: ListAPRColumnProps) => {
export const ListAPRColumn = ({
value,
incentives,
symbol,
tooltip,
children,
}: ListAPRColumnProps) => {
return (
<ListColumn>
<Box sx={{ display: 'flex' }}>
<IncentivesCard value={value} incentives={incentives} symbol={symbol} />
{tooltip}
</Box>
{children}
</ListColumn>
);
};
43 changes: 41 additions & 2 deletions src/modules/markets/Gho/GhoBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import GhoBorrowApyRange from 'src/components/GhoBorrowApyRange';
import { FormattedNumber } from 'src/components/primitives/FormattedNumber';
import { Link, ROUTES } from 'src/components/primitives/Link';
import { TokenIcon } from 'src/components/primitives/TokenIcon';
import { TextWithTooltip } from 'src/components/TextWithTooltip';
import {
ComputedReserveData,
useAppDataContext,
} from 'src/hooks/app-data-provider/useAppDataProvider';
import { useRootStore } from 'src/store/root';
import { GENERAL } from 'src/utils/mixPanelEvents';

interface GhoBannerProps {
reserve?: ComputedReserveData;
Expand Down Expand Up @@ -46,8 +48,9 @@ export const GhoBanner = ({ reserve }: GhoBannerProps) => {
}}
>
<Box
component={Link}
href={ROUTES.reserveOverview(reserve?.underlyingAsset || '', currentMarket)}
// NOTE: temp removed the link to the reserve overview page
// component={Link}
// href={ROUTES.reserveOverview(reserve?.underlyingAsset || '', currentMarket)}
sx={(theme) => ({
borderRadius: {
md: 4,
Expand Down Expand Up @@ -271,6 +274,42 @@ export const GhoBanner = ({ reserve }: GhoBannerProps) => {
<Trans>Borrow rate APY</Trans>
</Typography>
</Box>
<Link
href="https://governance.aave.com/t/arfc-merit-a-new-aave-alignment-user-reward-system/16646"
style={{ textDecoration: 'none', color: 'inherit', textAlign: 'center' }}
target="blank"
>
<Typography
sx={{
['@media screen and (min-width: 1125px)']: {
typography: 'description',
},
typography: {
xs: 'caption',
},
}}
variant="secondary14"
color="text.secondary"
>
<Trans>
Eligible for <strong>2.9M$</strong> GHO Community Program 👻
</Trans>
<TextWithTooltip
wrapperProps={{ sx: { display: 'inline-flex', alignItems: 'center' } }}
event={{
eventName: GENERAL.TOOL_TIP,
eventParams: {
tooltip: 'Community Rewards',
},
}}
>
<Trans>
This is a program initiated and implemented by the decentralised Aave community.
Aave Labs does not guarantee the program and accepts no liability.
</Trans>
</TextWithTooltip>
</Typography>
</Link>
</Box>
</Box>
<Button
Expand Down
32 changes: 31 additions & 1 deletion src/modules/markets/MarketAssetsListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import { RenFILToolTip } from 'src/components/infoTooltips/RenFILToolTip';
import { IsolatedEnabledBadge } from 'src/components/isolationMode/IsolatedBadge';
import { NoData } from 'src/components/primitives/NoData';
import { ReserveSubheader } from 'src/components/ReserveSubheader';
import { TextWithTooltip } from 'src/components/TextWithTooltip';
import { AssetsBeingOffboarded } from 'src/components/Warnings/OffboardingWarning';
import { useProtocolDataContext } from 'src/hooks/useProtocolDataContext';
import { useRootStore } from 'src/store/root';
import { GENERAL, MARKETS } from 'src/utils/mixPanelEvents';

import { IncentivesCard } from '../../components/incentives/IncentivesCard';
import { AMPLToolTip } from '../../components/infoTooltips/AMPLToolTip';
Expand All @@ -18,7 +20,6 @@ import { FormattedNumber } from '../../components/primitives/FormattedNumber';
import { Link, ROUTES } from '../../components/primitives/Link';
import { TokenIcon } from '../../components/primitives/TokenIcon';
import { ComputedReserveData } from '../../hooks/app-data-provider/useAppDataProvider';
import { MARKETS } from '../../utils/mixPanelEvents';

export const MarketAssetsListItem = ({ ...reserve }: ComputedReserveData) => {
const router = useRouter();
Expand Down Expand Up @@ -108,6 +109,35 @@ export const MarketAssetsListItem = ({ ...reserve }: ComputedReserveData) => {
{!reserve.borrowingEnabled &&
Number(reserve.totalVariableDebt) > 0 &&
!reserve.isFrozen && <ReserveSubheader value={'Disabled'} />}
{reserve.symbol === 'ETH' && currentMarket === 'proto_mainnet_v3' && (
<Box>
<Link
href="https://governance.aave.com/t/arfc-merit-a-new-aave-alignment-user-reward-system/16646"
style={{ textDecoration: 'none', color: 'inherit', textAlign: 'center' }}
target="blank"
>
<Typography variant="secondary14">
<Trans>
Eligible for <strong>2.1M$</strong> WETH Community Program 👻
</Trans>
<TextWithTooltip
wrapperProps={{ sx: { display: 'inline-flex', alignItems: 'center', ml: 1 } }}
event={{
eventName: GENERAL.TOOL_TIP,
eventParams: {
tooltip: 'Community Rewards',
},
}}
>
<Trans>
This is a program initiated and implemented by the decentralised Aave community.
Aave Labs does not guarantee the program and accepts no liability.
</Trans>
</TextWithTooltip>
</Typography>
</Link>
</Box>
)}
</ListColumn>
{/*
<ListColumn>
Expand Down
Loading

3 comments on commit 5476dd9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

Please sign in to comment.