소스 검색

支持侧边打开

visuddhinanda 2 년 전
부모
커밋
aa90f1ea0b
1개의 변경된 파일51개의 추가작업 그리고 39개의 파일을 삭제
  1. 51 39
      dashboard/src/components/template/SentEdit/SuggestionBox.tsx

+ 51 - 39
dashboard/src/components/template/SentEdit/SuggestionBox.tsx

@@ -45,14 +45,62 @@ const SuggestionBoxWidget = ({
       onClose();
       onClose();
     }
     }
   };
   };
-
+  const suggestion = (
+    <Space direction="vertical" style={{ width: "100%" }}>
+      <Card
+        title="温馨提示"
+        size="small"
+        style={{
+          width: "100%",
+          display: openNotification ? "block" : "none",
+        }}
+      >
+        <Marked
+          text="此处专为提交修改建议译文。您输入的应该是**译文**
+    而不是评论和问题。其他内容,请在讨论页面提交。"
+        />
+        <p style={{ textAlign: "center" }}>
+          <Button
+            onClick={() => {
+              localStorage.setItem("read_pr_Notification", "ok");
+              setOpenNotification(false);
+            }}
+          >
+            知道了
+          </Button>
+        </p>
+      </Card>
+      <SuggestionAdd
+        data={data}
+        onCreate={() => {
+          setReload(true);
+        }}
+      />
+      <SuggestionList
+        {...data}
+        reload={reload}
+        onReload={() => setReload(false)}
+        onChange={(count: number) => setPrNumber(count)}
+      />
+    </Space>
+  );
   return (
   return (
     <>
     <>
       <Space onClick={showDrawer}>
       <Space onClick={showDrawer}>
         {trigger}
         {trigger}
         {prNumber}
         {prNumber}
       </Space>
       </Space>
-
+      <div
+        style={{
+          position: "absolute",
+          display: isOpen ? "none" : "none",
+          zIndex: 1030,
+          marginLeft: 300,
+          marginTop: -250,
+        }}
+      >
+        {suggestion}
+      </div>
       <Drawer
       <Drawer
         title="修改建议"
         title="修改建议"
         width={520}
         width={520}
@@ -60,43 +108,7 @@ const SuggestionBoxWidget = ({
         open={isOpen}
         open={isOpen}
         maskClosable={false}
         maskClosable={false}
       >
       >
-        <Space direction="vertical" style={{ width: "100%" }}>
-          <Card
-            title="温馨提示"
-            size="small"
-            style={{
-              width: "100%",
-              display: openNotification ? "block" : "none",
-            }}
-          >
-            <Marked
-              text="此处专为提交修改建议译文。您输入的应该是**译文**
-              而不是评论和问题。其他内容,请在讨论页面提交。"
-            />
-            <p style={{ textAlign: "center" }}>
-              <Button
-                onClick={() => {
-                  localStorage.setItem("read_pr_Notification", "ok");
-                  setOpenNotification(false);
-                }}
-              >
-                知道了
-              </Button>
-            </p>
-          </Card>
-          <SuggestionAdd
-            data={data}
-            onCreate={() => {
-              setReload(true);
-            }}
-          />
-          <SuggestionList
-            {...data}
-            reload={reload}
-            onReload={() => setReload(false)}
-            onChange={(count: number) => setPrNumber(count)}
-          />
-        </Space>
+        {suggestion}
       </Drawer>
       </Drawer>
     </>
     </>
   );
   );