* added more details of the sale phases to the sale detail, added current region dates on the sale overview, links to other coretime resellers * refactor, separated components for readability * partial lint * arranged white boxes * added dotlake link, added price graph link, visual improvements * fixed incorrect sale times plus added an exception for the second sale on Kusams * lint and tsc * added ui colour * translation * wording change * typo
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
// Copyright 2017-2025 @polkadot/app-coretime authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { SaleParameters } from '../types.js';
|
|
|
|
import React, { useCallback } from 'react';
|
|
|
|
import { Button } from '@polkadot/react-components';
|
|
|
|
import { useTranslation } from '../translate.js';
|
|
import { constructSubscanQuery } from '../utils/index.js';
|
|
|
|
export const SubScanButton = ({ chainName, chosenSaleNumber, currentRegion }: { chosenSaleNumber: number, currentRegion: SaleParameters['currentRegion'], chainName: string }) => {
|
|
const { t } = useTranslation();
|
|
const onQuerySaleClick = useCallback(() => {
|
|
if (currentRegion) {
|
|
window.open(constructSubscanQuery(currentRegion.start.blocks.coretime, currentRegion.end.blocks.coretime, chainName));
|
|
}
|
|
}, [currentRegion, chainName]);
|
|
|
|
if (chosenSaleNumber === -1 || !currentRegion) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<Button
|
|
isBasic
|
|
label={t(`Query Subscan for sale #${chosenSaleNumber + 1} transactions`)}
|
|
onClick={onQuerySaleClick}
|
|
/>
|
|
);
|
|
};
|