|
@@ -25,17 +25,6 @@ const CommentBoxWidget = ({
|
|
|
const [topicComment, setTopicComment] = useState<IComment>();
|
|
const [topicComment, setTopicComment] = useState<IComment>();
|
|
|
const [answerCount, setAnswerCount] = useState<IAnswerCount>();
|
|
const [answerCount, setAnswerCount] = useState<IAnswerCount>();
|
|
|
|
|
|
|
|
- const showDrawer = () => {
|
|
|
|
|
- setOpen(true);
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- const onClose = () => {
|
|
|
|
|
- setOpen(false);
|
|
|
|
|
- if (document.getElementsByTagName("body")[0].hasAttribute("style")) {
|
|
|
|
|
- document.getElementsByTagName("body")[0].removeAttribute("style");
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
const showChildrenDrawer = (
|
|
const showChildrenDrawer = (
|
|
|
e: React.MouseEvent<HTMLSpanElement, MouseEvent>,
|
|
e: React.MouseEvent<HTMLSpanElement, MouseEvent>,
|
|
|
comment: IComment
|
|
comment: IComment
|
|
@@ -44,17 +33,24 @@ const CommentBoxWidget = ({
|
|
|
setTopicComment(comment);
|
|
setTopicComment(comment);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const onChildrenDrawerClose = () => {
|
|
|
|
|
- setChildrenDrawer(false);
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
- <span onClick={showDrawer}>{trigger}</span>
|
|
|
|
|
|
|
+ <span
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ setOpen(true);
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ {trigger}
|
|
|
|
|
+ </span>
|
|
|
<Drawer
|
|
<Drawer
|
|
|
title="Discussion"
|
|
title="Discussion"
|
|
|
width={520}
|
|
width={520}
|
|
|
- onClose={onClose}
|
|
|
|
|
|
|
+ onClose={() => {
|
|
|
|
|
+ setOpen(false);
|
|
|
|
|
+ if (document.getElementsByTagName("body")[0].hasAttribute("style")) {
|
|
|
|
|
+ document.getElementsByTagName("body")[0].removeAttribute("style");
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
open={open}
|
|
open={open}
|
|
|
maskClosable={false}
|
|
maskClosable={false}
|
|
|
>
|
|
>
|
|
@@ -72,7 +68,9 @@ const CommentBoxWidget = ({
|
|
|
<Drawer
|
|
<Drawer
|
|
|
title="回答"
|
|
title="回答"
|
|
|
width={480}
|
|
width={480}
|
|
|
- onClose={onChildrenDrawerClose}
|
|
|
|
|
|
|
+ onClose={() => {
|
|
|
|
|
+ setChildrenDrawer(false);
|
|
|
|
|
+ }}
|
|
|
open={childrenDrawer}
|
|
open={childrenDrawer}
|
|
|
>
|
|
>
|
|
|
<CommentTopic
|
|
<CommentTopic
|