Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning banners for Auctions and Crowdloans #10458

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading