mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
fixed stats
This commit is contained in:
parent
d3ce02e52b
commit
254f9c7af0
5 changed files with 17 additions and 19 deletions
|
@ -1,5 +1,6 @@
|
|||
import React, { FC } from 'react';
|
||||
import React, { FC, useMemo } from 'react';
|
||||
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { useRouter } from 'next/router';
|
||||
|
||||
import { BorisGraphicStats } from '~/components/boris/BorisGraphicStats';
|
||||
|
@ -33,11 +34,14 @@ type IProps = {
|
|||
isLoadingStats: boolean;
|
||||
};
|
||||
|
||||
const BorisLayout: FC<IProps> = ({ title, setIsBetaTester, isTester, stats, isLoadingStats }) => {
|
||||
const BorisLayout: FC<IProps> = observer(({ title, setIsBetaTester, isTester, stats, isLoadingStats }) => {
|
||||
const { isUser } = useAuthProvider();
|
||||
const openProfileSidebar = useShowModal(Dialog.ProfileSidebar);
|
||||
const { push } = useRouter();
|
||||
|
||||
const commentsByMonth = useMemo(() => stats.backend.comments.by_month?.slice(0, -1), [stats.backend.comments.by_month]);
|
||||
const nodesByMonth = useMemo(() => stats.backend.nodes.by_month?.slice(0, -1), [stats.backend.comments.by_month]);
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<div className={styles.wrap}>
|
||||
|
@ -74,9 +78,9 @@ const BorisLayout: FC<IProps> = ({ title, setIsBetaTester, isTester, stats, isLo
|
|||
|
||||
<BorisGraphicStats
|
||||
totalComments={stats.backend.comments.total}
|
||||
commentsByMonth={stats.backend.comments.by_month}
|
||||
commentsByMonth={commentsByMonth}
|
||||
totalNodes={stats.backend.nodes.total}
|
||||
nodesByMonth={stats.backend.nodes.by_month}
|
||||
nodesByMonth={nodesByMonth}
|
||||
/>
|
||||
|
||||
<BorisComments />
|
||||
|
@ -100,6 +104,6 @@ const BorisLayout: FC<IProps> = ({ title, setIsBetaTester, isTester, stats, isLo
|
|||
<SidebarRouter prefix="/" />
|
||||
</Container>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
export { BorisLayout };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue