1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

removed boris reducer

This commit is contained in:
Fedor Katurov 2022-01-02 21:28:31 +07:00
parent 77af1ab05a
commit 120bf8954c
72 changed files with 225 additions and 298 deletions

View file

@ -1,27 +1,28 @@
import React, { FC, useMemo } from 'react';
import { IBorisState } from '~/redux/boris/reducer';
import { GithubIssue } from '~/types/boris';
import styles from './styles.module.scss';
import { Placeholder } from '~/components/placeholders/Placeholder';
import { BorisStatsGitCard } from '../BorisStatsGitCard';
interface IProps {
stats: IBorisState['stats'];
issues: GithubIssue[];
isLoading: boolean;
}
const BorisStatsGit: FC<IProps> = ({ stats }) => {
const BorisStatsGit: FC<IProps> = ({ issues, isLoading }) => {
const open = useMemo(
() => stats.issues.filter(el => !el.pull_request && el.state === 'open').slice(0, 5),
[stats.issues]
() => issues.filter(el => !el.pull_request && el.state === 'open').slice(0, 5),
[issues]
);
const closed = useMemo(
() => stats.issues.filter(el => !el.pull_request && el.state === 'closed').slice(0, 5),
[stats.issues]
() => issues.filter(el => !el.pull_request && el.state === 'closed').slice(0, 5),
[issues]
);
if (!stats.issues.length) return null;
if (!issues.length) return null;
if (stats.is_loading) {
if (isLoading) {
return (
<>
<div className={styles.stats__title}>