visuddhinanda 3 лет назад
Родитель
Сommit
8b45ab50d1

+ 24 - 5
dashboard/src/components/article/RightPanel.tsx

@@ -1,3 +1,4 @@
+import { Affix } from "antd";
 import { useEffect, useState } from "react";
 import { useEffect, useState } from "react";
 
 
 import DictComponent from "../dict/DictComponent";
 import DictComponent from "../dict/DictComponent";
@@ -27,12 +28,30 @@ const Widget = ({ curr = "close" }: IWidget) => {
     }
     }
   }, [curr]);
   }, [curr]);
   return (
   return (
-    <div>
-      <div style={{ width: 350, display: dict }}>
-        <DictComponent />
+    <Affix offsetTop={44}>
+      <div>
+        <div
+          style={{
+            width: 350,
+            height: `calc(100vh - 44px)`,
+            overflowY: "scroll",
+            display: dict,
+          }}
+        >
+          <DictComponent />
+        </div>
+        <div
+          style={{
+            width: 350,
+            height: `calc(100vh - 44px)`,
+            overflowY: "scroll",
+            display: channel,
+          }}
+        >
+          channel
+        </div>
       </div>
       </div>
-      <div style={{ width: 350, display: channel }}>channel</div>
-    </div>
+    </Affix>
   );
   );
 };
 };
 
 

+ 1 - 5
dashboard/src/components/dict/DictComponent.tsx

@@ -18,11 +18,7 @@ const Widget = ({ word }: IWidgetDict) => {
     }
     }
   }, [commandMsg]);
   }, [commandMsg]);
 
 
-  return (
-    <div style={{ height: `calc(100vh - 44px)`, overflowY: "scroll" }}>
-      <Dictionary word={wordSearch} compact={true} />
-    </div>
-  );
+  return <Dictionary word={wordSearch} compact={true} />;
 };
 };
 
 
 export default Widget;
 export default Widget;