Skip to content

Commit

Permalink
Add warning banners for Auctions and Crowdloans (#10458)
Browse files Browse the repository at this point in the history
  • Loading branch information
TarikGul authored Apr 11, 2024
1 parent 2c47246 commit a1d2458
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion packages/page-parachains/src/Auctions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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}
Expand Down
8 changes: 7 additions & 1 deletion packages/page-parachains/src/Crowdloan/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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}
Expand Down

0 comments on commit a1d2458

Please sign in to comment.