瀏覽代碼

:sparkles: 发送点词查询消息

visuddhinanda 3 年之前
父節點
當前提交
424336697e
共有 1 個文件被更改,包括 14 次插入0 次删除
  1. 14 0
      dashboard/src/components/template/Wbw/WbwPali.tsx

+ 14 - 0
dashboard/src/components/template/Wbw/WbwPali.tsx

@@ -14,6 +14,9 @@ import { PaliReal } from "../../../utils";
 import WbwVideoButton from "./WbwVideoButton";
 import CommentBox from "../../comment/CommentBox";
 import PaliText from "./PaliText";
+import store from "../../../store";
+import { command } from "../../../reducers/command";
+import { IWidgetDict } from "../../dict/DictComponent";
 
 const { Paragraph } = Typography;
 interface IWidget {
@@ -166,6 +169,17 @@ const Widget = ({ data, display, onSave }: IWidget) => {
         onMouseLeave={() => {
           setIsHover(false);
         }}
+        onClick={() => {
+          //发送点词查询消息
+          store.dispatch(
+            command({
+              prop: {
+                word: data.word.value,
+              },
+              type: "dict",
+            })
+          );
+        }}
       >
         <Popover
           content={wbwDetail}