mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
made boris graphic stats
This commit is contained in:
parent
c0f8766ec6
commit
857993e354
11 changed files with 218 additions and 35 deletions
46
src/components/boris/BorisGraphicStats/index.tsx
Normal file
46
src/components/boris/BorisGraphicStats/index.tsx
Normal file
|
@ -0,0 +1,46 @@
|
|||
import React, { VFC } from 'react';
|
||||
|
||||
import { parseISO } from 'date-fns/esm';
|
||||
|
||||
import { BasicCurveChart } from '~/components/charts/BasicCurveChart';
|
||||
import { StatsCard } from '~/components/charts/StatsCard';
|
||||
import { StatsCountdownCard } from '~/components/charts/StatsCountdownCard';
|
||||
import { foundationDate } from '~/constants/boris/constants';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
interface BorisGraphicStatsProps {
|
||||
totalNodes: number;
|
||||
nodesByMonth: number[];
|
||||
totalComments: number;
|
||||
commentsByMonth: number[];
|
||||
}
|
||||
|
||||
const BorisGraphicStats: VFC<BorisGraphicStatsProps> = ({
|
||||
totalComments,
|
||||
commentsByMonth,
|
||||
totalNodes,
|
||||
nodesByMonth,
|
||||
}) => {
|
||||
return (
|
||||
<div className={styles.group}>
|
||||
<StatsCard
|
||||
background={<BasicCurveChart items={nodesByMonth} />}
|
||||
title="Посты"
|
||||
total={totalNodes}
|
||||
className={styles.card}
|
||||
/>
|
||||
|
||||
<StatsCard
|
||||
background={<BasicCurveChart items={commentsByMonth} />}
|
||||
title="Комментарии"
|
||||
total={totalComments}
|
||||
className={styles.card}
|
||||
/>
|
||||
|
||||
<StatsCountdownCard since={parseISO(foundationDate)} className={styles.card} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export { BorisGraphicStats };
|
12
src/components/boris/BorisGraphicStats/styles.module.scss
Normal file
12
src/components/boris/BorisGraphicStats/styles.module.scss
Normal file
|
@ -0,0 +1,12 @@
|
|||
@import 'src/styles/variables';
|
||||
|
||||
.group {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
grid-column-gap: $gap;
|
||||
grid-row-gap: $gap;
|
||||
}
|
||||
|
||||
.card {
|
||||
height: 150px;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue