mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
#23 adde comment_count and last_seen to lab
This commit is contained in:
parent
ccec211727
commit
5f938cfa92
4 changed files with 18 additions and 6 deletions
|
@ -1,6 +1,5 @@
|
||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
import { Group } from '~/components/containers/Group';
|
import { Group } from '~/components/containers/Group';
|
||||||
import { Icon } from '~/components/input/Icon';
|
|
||||||
import { INodeComponentProps } from '~/redux/node/constants';
|
import { INodeComponentProps } from '~/redux/node/constants';
|
||||||
import { Filler } from '~/components/containers/Filler';
|
import { Filler } from '~/components/containers/Filler';
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
|
|
@ -2,15 +2,22 @@ import React, { FC } from 'react';
|
||||||
import { INode } from '~/redux/types';
|
import { INode } from '~/redux/types';
|
||||||
import { useNodeBlocks } from '~/utils/hooks/node/useNodeBlocks';
|
import { useNodeBlocks } from '~/utils/hooks/node/useNodeBlocks';
|
||||||
import styles from './styles.module.scss';
|
import styles from './styles.module.scss';
|
||||||
|
import { LabBottomPanel } from '~/components/lab/LabBottomPanel';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
node: INode;
|
node: INode;
|
||||||
|
isLoading?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LabNode: FC<IProps> = ({ node }) => {
|
const LabNode: FC<IProps> = ({ node, isLoading }) => {
|
||||||
const { lab } = useNodeBlocks(node, false);
|
const { lab } = useNodeBlocks(node, false);
|
||||||
|
|
||||||
return <div className={styles.wrap}>{lab}</div>;
|
return (
|
||||||
|
<div className={styles.wrap}>
|
||||||
|
{lab}
|
||||||
|
<LabBottomPanel node={node} isLoading={!!isLoading} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { LabNode };
|
export { LabNode };
|
||||||
|
|
|
@ -12,7 +12,7 @@ const LabGrid: FC<IProps> = () => {
|
||||||
return (
|
return (
|
||||||
<div className={styles.wrap}>
|
<div className={styles.wrap}>
|
||||||
{nodes.map(node => (
|
{nodes.map(node => (
|
||||||
<LabNode node={node} key={node.id} />
|
<LabNode node={node.node} key={node.node.id} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { IError, INode, ITag } from '~/redux/types';
|
||||||
export type ILabState = Readonly<{
|
export type ILabState = Readonly<{
|
||||||
list: {
|
list: {
|
||||||
is_loading: boolean;
|
is_loading: boolean;
|
||||||
nodes: INode[];
|
nodes: ILabNode[];
|
||||||
count: number;
|
count: number;
|
||||||
error: IError;
|
error: IError;
|
||||||
};
|
};
|
||||||
|
@ -19,8 +19,14 @@ export type GetLabNodesRequest = {
|
||||||
after?: string;
|
after?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export interface ILabNode {
|
||||||
|
node: INode;
|
||||||
|
last_seen: string | null;
|
||||||
|
comment_count: number;
|
||||||
|
}
|
||||||
|
|
||||||
export type GetLabNodesResult = {
|
export type GetLabNodesResult = {
|
||||||
nodes: INode[];
|
nodes: ILabNode[];
|
||||||
count: number;
|
count: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue