ElectionBanner.tsx 742 B

123456789101112131415161718192021222324252627
  1. // Copyright 2017-2020 @polkadot/app-staking authors & contributors
  2. // This software may be modified and distributed under the terms
  3. // of the Apache-2.0 license. See the LICENSE file for details.
  4. import React from 'react';
  5. import { useTranslation } from './translate';
  6. interface Props {
  7. isInElection?: boolean;
  8. }
  9. function ElectionBanner ({ isInElection }: Props): React.ReactElement<Props> | null {
  10. const { t } = useTranslation();
  11. if (!isInElection) {
  12. return null;
  13. }
  14. return (
  15. <article className='warning nomargin'>
  16. {t<string>('There is currently an ongoing election for new validator candidates. As such staking operations are not permitted.')}
  17. </article>
  18. );
  19. }
  20. export default React.memo(ElectionBanner);