fix(governance): rewards moved to console notification (#5904)
This commit is contained in:
parent
b163af3e8a
commit
bbfe42ddb1
@ -0,0 +1,44 @@
|
|||||||
|
import {
|
||||||
|
useLinks,
|
||||||
|
DApp,
|
||||||
|
CONSOLE_REWARDS_PAGE,
|
||||||
|
} from '@vegaprotocol/environment';
|
||||||
|
import {
|
||||||
|
ExternalLink,
|
||||||
|
Intent,
|
||||||
|
NotificationBanner,
|
||||||
|
VegaIcon,
|
||||||
|
VegaIconNames,
|
||||||
|
} from '@vegaprotocol/ui-toolkit';
|
||||||
|
import { Trans } from 'react-i18next';
|
||||||
|
import { useMatch } from 'react-router-dom';
|
||||||
|
import Routes from '../../routes/routes';
|
||||||
|
import { type ReactNode } from 'react';
|
||||||
|
|
||||||
|
const ConsoleRewardsLink = ({ children }: { children: ReactNode }) => {
|
||||||
|
const consoleLink = useLinks(DApp.Console);
|
||||||
|
return (
|
||||||
|
<ExternalLink
|
||||||
|
href={consoleLink(CONSOLE_REWARDS_PAGE)}
|
||||||
|
className="underline inline-flex gap-1 items-center"
|
||||||
|
title="Rewards in Console"
|
||||||
|
>
|
||||||
|
<span>{children}</span>
|
||||||
|
<VegaIcon size={12} name={VegaIconNames.OPEN_EXTERNAL} />
|
||||||
|
</ExternalLink>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const RewardsMovedNotification = () => {
|
||||||
|
const onRewardsPage = useMatch(Routes.REWARDS);
|
||||||
|
if (!onRewardsPage) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<NotificationBanner intent={Intent.Warning}>
|
||||||
|
<Trans
|
||||||
|
i18nKey="rewardsMovedNotification"
|
||||||
|
components={[<ConsoleRewardsLink>Console</ConsoleRewardsLink>]}
|
||||||
|
/>
|
||||||
|
</NotificationBanner>
|
||||||
|
);
|
||||||
|
};
|
@ -10,6 +10,7 @@ import {
|
|||||||
ProtocolUpgradeProposalNotification,
|
ProtocolUpgradeProposalNotification,
|
||||||
} from '@vegaprotocol/proposals';
|
} from '@vegaprotocol/proposals';
|
||||||
import { ViewingAsBanner } from '@vegaprotocol/ui-toolkit';
|
import { ViewingAsBanner } from '@vegaprotocol/ui-toolkit';
|
||||||
|
import { RewardsMovedNotification } from '../notifications/rewards-moved-notification';
|
||||||
|
|
||||||
interface AppLayoutProps {
|
interface AppLayoutProps {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
@ -45,8 +46,10 @@ export const AppLayout = ({ children }: AppLayoutProps) => {
|
|||||||
|
|
||||||
const NotificationsContainer = () => {
|
const NotificationsContainer = () => {
|
||||||
const { isReadOnly, pubKey, disconnect } = useVegaWallet();
|
const { isReadOnly, pubKey, disconnect } = useVegaWallet();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div data-testid="banners">
|
<div data-testid="banners">
|
||||||
|
<RewardsMovedNotification />
|
||||||
<ProtocolUpgradeProposalNotification
|
<ProtocolUpgradeProposalNotification
|
||||||
mode={ProtocolUpgradeCountdownMode.IN_ESTIMATED_TIME_REMAINING}
|
mode={ProtocolUpgradeCountdownMode.IN_ESTIMATED_TIME_REMAINING}
|
||||||
/>
|
/>
|
||||||
|
@ -134,6 +134,7 @@ export const CONSOLE_TRANSFER = '#/portfolio/assets/transfer';
|
|||||||
export const CONSOLE_TRANSFER_ASSET =
|
export const CONSOLE_TRANSFER_ASSET =
|
||||||
'#/portfolio/assets/transfer?assetId=:assetId';
|
'#/portfolio/assets/transfer?assetId=:assetId';
|
||||||
export const CONSOLE_MARKET_PAGE = '#/markets/:marketId';
|
export const CONSOLE_MARKET_PAGE = '#/markets/:marketId';
|
||||||
|
export const CONSOLE_REWARDS_PAGE = '#/rewards';
|
||||||
|
|
||||||
// Governance pages
|
// Governance pages
|
||||||
export const TOKEN_NEW_MARKET_PROPOSAL = '/proposals/propose/new-market';
|
export const TOKEN_NEW_MARKET_PROPOSAL = '/proposals/propose/new-market';
|
||||||
|
@ -969,5 +969,6 @@
|
|||||||
"YourIdentityAnonymous": "Your identity is always anonymous on Vega",
|
"YourIdentityAnonymous": "Your identity is always anonymous on Vega",
|
||||||
"yourStake": "Your stake",
|
"yourStake": "Your stake",
|
||||||
"yourVote": "Your vote",
|
"yourVote": "Your vote",
|
||||||
"youVoted": "You voted"
|
"youVoted": "You voted",
|
||||||
|
"rewardsMovedNotification": "Trading and liquidity rewards have moved. Visit <0>Console</0> to view your rewards."
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user