mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
#25 groupping issues by type
This commit is contained in:
parent
bb6c853d3c
commit
054f3041c4
1 changed files with 18 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
|||
import React, { FC } from 'react';
|
||||
import React, { FC, useMemo } from 'react';
|
||||
import { IBorisState } from '~/redux/boris/reducer';
|
||||
import styles from './styles.module.scss';
|
||||
import { Placeholder } from '~/components/placeholders/Placeholder';
|
||||
|
@ -11,6 +11,16 @@ interface IProps {
|
|||
const BorisStatsGit: FC<IProps> = ({ stats }) => {
|
||||
if (!stats.issues.length) return null;
|
||||
|
||||
const open = useMemo(
|
||||
() => stats.issues.filter(el => !el.pull_request && el.state === 'open').slice(0, 5),
|
||||
[stats.issues]
|
||||
);
|
||||
|
||||
const closed = useMemo(
|
||||
() => stats.issues.filter(el => !el.pull_request && el.state === 'closed').slice(0, 5),
|
||||
[stats.issues]
|
||||
);
|
||||
|
||||
if (stats.is_loading) {
|
||||
return (
|
||||
<>
|
||||
|
@ -35,12 +45,13 @@ const BorisStatsGit: FC<IProps> = ({ stats }) => {
|
|||
<img src="https://jenkins.vault48.org/api/badges/muerwre/vault-golang/status.svg" />
|
||||
</div>
|
||||
|
||||
{stats.issues
|
||||
.filter(el => !el.pull_request)
|
||||
.slice(0, 10)
|
||||
.map(data => (
|
||||
<BorisStatsGitCard data={data} key={data.id} />
|
||||
))}
|
||||
{closed.map(data => (
|
||||
<BorisStatsGitCard data={data} key={data.id} />
|
||||
))}
|
||||
|
||||
{open.map(data => (
|
||||
<BorisStatsGitCard data={data} key={data.id} />
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue