mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 21:06:42 +07:00
removed boris reducer
This commit is contained in:
parent
77af1ab05a
commit
120bf8954c
72 changed files with 225 additions and 298 deletions
|
@ -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}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue