1
0
Fork 0
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:
Fedor Katurov 2022-03-30 18:39:58 +07:00
parent c0f8766ec6
commit 857993e354
11 changed files with 218 additions and 35 deletions

View 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 };

View 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;
}