mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
refactored boris components
This commit is contained in:
parent
df217b41f7
commit
e071665561
6 changed files with 6 additions and 6 deletions
|
@ -9,8 +9,6 @@ interface IProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
const BorisStatsGit: FC<IProps> = ({ stats }) => {
|
const BorisStatsGit: FC<IProps> = ({ stats }) => {
|
||||||
if (!stats.issues.length) return null;
|
|
||||||
|
|
||||||
const open = useMemo(
|
const open = useMemo(
|
||||||
() => stats.issues.filter(el => !el.pull_request && el.state === 'open').slice(0, 5),
|
() => stats.issues.filter(el => !el.pull_request && el.state === 'open').slice(0, 5),
|
||||||
[stats.issues]
|
[stats.issues]
|
||||||
|
@ -21,6 +19,8 @@ const BorisStatsGit: FC<IProps> = ({ stats }) => {
|
||||||
[stats.issues]
|
[stats.issues]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!stats.issues.length) return null;
|
||||||
|
|
||||||
if (stats.is_loading) {
|
if (stats.is_loading) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -14,10 +14,10 @@ const stateLabels: Record<IGithubIssue['state'], string> = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const BorisStatsGitCard: FC<IProps> = ({ data: { created_at, title, html_url, state } }) => {
|
const BorisStatsGitCard: FC<IProps> = ({ data: { created_at, title, html_url, state } }) => {
|
||||||
if (!title || !created_at) return null;
|
|
||||||
|
|
||||||
const date = useMemo(() => getPrettyDate(created_at), [created_at]);
|
const date = useMemo(() => getPrettyDate(created_at), [created_at]);
|
||||||
|
|
||||||
|
if (!title || !created_at) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.wrap}>
|
<div className={styles.wrap}>
|
||||||
<div className={styles.time}>
|
<div className={styles.time}>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { FC, memo } from 'react';
|
import React, { FC } from 'react';
|
||||||
import { useShallowSelect } from '~/utils/hooks/useShallowSelect';
|
import { useShallowSelect } from '~/utils/hooks/useShallowSelect';
|
||||||
import { selectAuthIsTester, selectUser } from '~/redux/auth/selectors';
|
import { selectAuthIsTester, selectUser } from '~/redux/auth/selectors';
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { Group } from '~/components/containers/Group';
|
||||||
import boris from '~/sprites/boris_robot.svg';
|
import boris from '~/sprites/boris_robot.svg';
|
||||||
import { Container } from '~/containers/main/Container';
|
import { Container } from '~/containers/main/Container';
|
||||||
import StickyBox from 'react-sticky-box/dist/esnext';
|
import StickyBox from 'react-sticky-box/dist/esnext';
|
||||||
import { BorisComments } from '~/components/boris/BorisComments';
|
import { BorisComments } from '~/views/boris/BorisComments';
|
||||||
import { Card } from '~/components/containers/Card';
|
import { Card } from '~/components/containers/Card';
|
||||||
import { SidebarRouter } from '~/containers/main/SidebarRouter';
|
import { SidebarRouter } from '~/containers/main/SidebarRouter';
|
||||||
import { BorisSidebar } from '~/components/boris/BorisSidebar';
|
import { BorisSidebar } from '~/components/boris/BorisSidebar';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue