mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* add EmptyState component to toolkit and use it in the stats page * remove EmptySearchResult component * tweaks * refactor ComingSoon component * fix toolkit build * rollback changes in main preset
66 lines
1.7 KiB
TypeScript
66 lines
1.7 KiB
TypeScript
import { Box } from '@chakra-ui/react';
|
|
import React from 'react';
|
|
|
|
import config from 'configs/app';
|
|
import useEtherscanRedirects from 'lib/router/useEtherscanRedirects';
|
|
import PageTitle from 'ui/shared/Page/PageTitle';
|
|
|
|
import ChartsWidgetsList from '../stats/ChartsWidgetsList';
|
|
import NumberWidgetsList from '../stats/NumberWidgetsList';
|
|
import StatsFilters from '../stats/StatsFilters';
|
|
import useStats from '../stats/useStats';
|
|
|
|
const Stats = () => {
|
|
const {
|
|
isPlaceholderData,
|
|
isError,
|
|
sections,
|
|
currentSection,
|
|
handleSectionChange,
|
|
interval,
|
|
handleIntervalChange,
|
|
handleFilterChange,
|
|
displayedCharts,
|
|
initialFilterQuery,
|
|
} = useStats();
|
|
|
|
useEtherscanRedirects();
|
|
|
|
return (
|
|
<>
|
|
<PageTitle
|
|
title={ config.meta.seo.enhancedDataEnabled ? `${ config.chain.name } statistic & data` : `${ config.chain.name } stats` }
|
|
/>
|
|
|
|
<Box mb={{ base: 6, sm: 8 }}>
|
|
<NumberWidgetsList/>
|
|
</Box>
|
|
|
|
<Box mb={{ base: 6, sm: 8 }}>
|
|
<StatsFilters
|
|
isLoading={ isPlaceholderData }
|
|
initialFilterValue={ initialFilterQuery }
|
|
sections={ sections }
|
|
currentSection={ currentSection }
|
|
onSectionChange={ handleSectionChange }
|
|
interval={ interval }
|
|
onIntervalChange={ handleIntervalChange }
|
|
onFilterInputChange={ handleFilterChange }
|
|
/>
|
|
</Box>
|
|
|
|
<ChartsWidgetsList
|
|
initialFilterQuery={ initialFilterQuery }
|
|
isError={ isError }
|
|
isPlaceholderData={ isPlaceholderData }
|
|
charts={ displayedCharts }
|
|
interval={ interval }
|
|
sections={ sections }
|
|
selectedSectionId={ currentSection }
|
|
/>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default Stats;
|