Add warning banners for Auctions and Crowdloans (#10458)

This commit is contained in:
Tarik Gul 2024-04-11 08:44:15 -04:00 committed by GitHub
parent 2c47246220
commit a1d2458347
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -5,8 +5,9 @@ import type { AuctionInfo, Campaigns, OwnedId, Winning } from '../types.js';
import React from 'react';
import { Button } from '@polkadot/react-components';
import { Button, MarkWarning } from '@polkadot/react-components';
import { useTranslation } from '../translate.js';
import Auction from './Auction.js';
import Bid from './Bid.js';
import Summary from './Summary.js';
@ -20,10 +21,15 @@ interface Props {
}
function Auctions ({ auctionInfo, campaigns, className, ownedIds, winningData }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const lastWinners = winningData?.[0];
return (
<div className={className}>
<MarkWarning
className='warning centered'
content={t('Auctions will be deprecated in favor of Coretime. When Coretime is active in Polkadot, this page will be removed.')}
/>
<Summary
auctionInfo={auctionInfo}
lastWinners={lastWinners}

View File

@ -5,9 +5,10 @@ import type { AuctionInfo, Campaigns, LeasePeriod, OwnedId } from '../types.js';
import React from 'react';
import { Button } from '@polkadot/react-components';
import { Button, MarkWarning } from '@polkadot/react-components';
import { useBestNumber } from '@polkadot/react-hooks';
import { useTranslation } from '../translate.js';
import FundAdd from './FundAdd.js';
import Funds from './Funds.js';
import Summary from './Summary.js';
@ -21,10 +22,15 @@ interface Props {
}
function Crowdloan ({ auctionInfo, campaigns: { activeCap, activeRaised, funds, isLoading, totalCap, totalRaised }, className, leasePeriod, ownedIds }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const bestNumber = useBestNumber();
return (
<div className={className}>
<MarkWarning
className='warning centered'
content={t('Crowdloans will be deprecated in favor of Coretime. When Coretime is active in Polkadot, this page will be removed.')}
/>
<Summary
activeCap={activeCap}
activeRaised={activeRaised}