From 5f938cfa92a39c74d39e035a2f5442b2aacc2e4b Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Wed, 24 Mar 2021 14:53:29 +0700 Subject: [PATCH] #23 adde comment_count and last_seen to lab --- src/components/lab/LabBottomPanel/index.tsx | 1 - src/components/lab/LabNode/index.tsx | 11 +++++++++-- src/containers/lab/LabGrid/index.tsx | 2 +- src/redux/lab/types.ts | 10 ++++++++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/components/lab/LabBottomPanel/index.tsx b/src/components/lab/LabBottomPanel/index.tsx index 16024efd..9e9d6316 100644 --- a/src/components/lab/LabBottomPanel/index.tsx +++ b/src/components/lab/LabBottomPanel/index.tsx @@ -1,6 +1,5 @@ import React, { FC } from 'react'; import { Group } from '~/components/containers/Group'; -import { Icon } from '~/components/input/Icon'; import { INodeComponentProps } from '~/redux/node/constants'; import { Filler } from '~/components/containers/Filler'; import styles from './styles.module.scss'; diff --git a/src/components/lab/LabNode/index.tsx b/src/components/lab/LabNode/index.tsx index 9b5a212a..4d5fe911 100644 --- a/src/components/lab/LabNode/index.tsx +++ b/src/components/lab/LabNode/index.tsx @@ -2,15 +2,22 @@ import React, { FC } from 'react'; import { INode } from '~/redux/types'; import { useNodeBlocks } from '~/utils/hooks/node/useNodeBlocks'; import styles from './styles.module.scss'; +import { LabBottomPanel } from '~/components/lab/LabBottomPanel'; interface IProps { node: INode; + isLoading?: boolean; } -const LabNode: FC = ({ node }) => { +const LabNode: FC = ({ node, isLoading }) => { const { lab } = useNodeBlocks(node, false); - return
{lab}
; + return ( +
+ {lab} + +
+ ); }; export { LabNode }; diff --git a/src/containers/lab/LabGrid/index.tsx b/src/containers/lab/LabGrid/index.tsx index b6961b5f..5dc8c816 100644 --- a/src/containers/lab/LabGrid/index.tsx +++ b/src/containers/lab/LabGrid/index.tsx @@ -12,7 +12,7 @@ const LabGrid: FC = () => { return (
{nodes.map(node => ( - + ))}
); diff --git a/src/redux/lab/types.ts b/src/redux/lab/types.ts index 9a30aebe..4a188e97 100644 --- a/src/redux/lab/types.ts +++ b/src/redux/lab/types.ts @@ -3,7 +3,7 @@ import { IError, INode, ITag } from '~/redux/types'; export type ILabState = Readonly<{ list: { is_loading: boolean; - nodes: INode[]; + nodes: ILabNode[]; count: number; error: IError; }; @@ -19,8 +19,14 @@ export type GetLabNodesRequest = { after?: string; }; +export interface ILabNode { + node: INode; + last_seen: string | null; + comment_count: number; +} + export type GetLabNodesResult = { - nodes: INode[]; + nodes: ILabNode[]; count: number; };