|
@@ -13,6 +13,7 @@ export interface IComment {
|
|
|
parent?: string | null;
|
|
parent?: string | null;
|
|
|
title?: string;
|
|
title?: string;
|
|
|
content?: string;
|
|
content?: string;
|
|
|
|
|
+ status?: "active" | "close";
|
|
|
children?: IComment[];
|
|
children?: IComment[];
|
|
|
childrenCount?: number;
|
|
childrenCount?: number;
|
|
|
createdAt?: string;
|
|
createdAt?: string;
|
|
@@ -25,6 +26,7 @@ interface IWidget {
|
|
|
onCreated?: Function;
|
|
onCreated?: Function;
|
|
|
onDelete?: Function;
|
|
onDelete?: Function;
|
|
|
onReply?: Function;
|
|
onReply?: Function;
|
|
|
|
|
+ onClose?: Function;
|
|
|
}
|
|
}
|
|
|
const DiscussionItemWidget = ({
|
|
const DiscussionItemWidget = ({
|
|
|
data,
|
|
data,
|
|
@@ -33,6 +35,7 @@ const DiscussionItemWidget = ({
|
|
|
onCreated,
|
|
onCreated,
|
|
|
onDelete,
|
|
onDelete,
|
|
|
onReply,
|
|
onReply,
|
|
|
|
|
+ onClose,
|
|
|
}: IWidget) => {
|
|
}: IWidget) => {
|
|
|
const [edit, setEdit] = useState(false);
|
|
const [edit, setEdit] = useState(false);
|
|
|
const [currData, setCurrData] = useState<IComment>(data);
|
|
const [currData, setCurrData] = useState<IComment>(data);
|
|
@@ -47,7 +50,7 @@ const DiscussionItemWidget = ({
|
|
|
padding: 5,
|
|
padding: 5,
|
|
|
}}
|
|
}}
|
|
|
>
|
|
>
|
|
|
- <div style={{ width: "2em" }}>
|
|
|
|
|
|
|
+ <div style={{ width: "2em", display: "none" }}>
|
|
|
<Avatar size="small">{data.user?.nickName?.slice(0, 1)}</Avatar>
|
|
<Avatar size="small">{data.user?.nickName?.slice(0, 1)}</Avatar>
|
|
|
</div>
|
|
</div>
|
|
|
<div style={{ width: "100%" }}>
|
|
<div style={{ width: "100%" }}>
|
|
@@ -86,6 +89,11 @@ const DiscussionItemWidget = ({
|
|
|
onReply(currData);
|
|
onReply(currData);
|
|
|
}
|
|
}
|
|
|
}}
|
|
}}
|
|
|
|
|
+ onClose={() => {
|
|
|
|
|
+ if (typeof onClose !== "undefined") {
|
|
|
|
|
+ onClose();
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
/>
|
|
/>
|
|
|
)}
|
|
)}
|
|
|
</div>
|
|
</div>
|