Skip to content

Commit 84a0274

Browse files
Added nominations banner to Targets and Staking Overview pages (#130)
Banner is displayed in all Aleph Zero envs 1. Page Staking/Overview ![image](https://github.com/user-attachments/assets/1c2e56bf-697f-4b23-802d-c169066d02c3) 2. Page Staking/Targets ![image](https://github.com/user-attachments/assets/05cde04f-9c5e-4117-81fa-f78be71fe69b)
1 parent 0bbce06 commit 84a0274

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2017-2024 @polkadot/app-staking authors & contributors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import React from 'react';
5+
6+
import { MarkWarning } from '@polkadot/react-components';
7+
8+
import { useTranslation } from './translate.js';
9+
10+
function ElectionBanner (): React.ReactElement<null> | null {
11+
const { t } = useTranslation();
12+
13+
return (
14+
<MarkWarning
15+
className='warning centered'
16+
content={t('On December 16th, the Mainnet decentralizes as 9 AZF nodes are replaced by community validators in the block finalization committee. If you’re staking with an AZF node, switch to a Community Validator to keep earning rewards!')}
17+
/>
18+
);
19+
}
20+
21+
export default React.memo(ElectionBanner);

packages/page-staking/src/Targets/index.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { useApi, useAvailableSlashes, useSavedFlags } from '@polkadot/react-hook
1515
import { MAX_NOMINATIONS } from '../constants.js';
1616
import ElectionBanner from '../ElectionBanner.js';
1717
import Filtering from '../Filtering.js';
18+
import NominationsBanner from '../NominationsBanner.js';
1819
import { useTranslation } from '../translate.js';
1920
import useIdentities from '../useIdentities.js';
2021
import Nominate from './Nominate.js';
@@ -255,6 +256,7 @@ function Targets ({ className = '', isInElection, nominatedBy, ownStashes, targe
255256
totalIssuance={totalIssuance}
256257
totalStaked={totalStaked}
257258
/>
259+
<NominationsBanner />
258260
<Button.Group>
259261
<Button
260262
icon='check'

packages/page-staking/src/Validators/index.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
1010
import { Button, ToggleGroup } from '@polkadot/react-components';
1111
import { useApi, useCall } from '@polkadot/react-hooks';
1212

13+
import NominationsBanner from '../NominationsBanner.js';
1314
import { useTranslation } from '../translate.js';
1415
import ActionsBanner from './ActionsBanner.js';
1516
import CurrentList from './CurrentList.js';
@@ -63,6 +64,7 @@ function Overview ({ className = '', favorites, hasAccounts, hasQueries, nominat
6364
{hasAccounts && (ownStashes?.length === 0) && (
6465
<ActionsBanner />
6566
)}
67+
<NominationsBanner />
6668
<Button.Group>
6769
<ToggleGroup
6870
onChange={setTypeIndex}

0 commit comments

Comments
 (0)