ソースを参照

:sparkles: 点词查询 #1148

visuddhinanda 2 年 前
コミット
851ba006e1
1 ファイル変更6 行追加2 行削除
  1. 6 2
      dashboard/src/components/template/Wbw/WbwDetailFm.tsx

+ 6 - 2
dashboard/src/components/template/Wbw/WbwDetailFm.tsx

@@ -10,6 +10,8 @@ import {
 import { useAppSelector } from "../../../hooks";
 
 import { inlineDict as _inlineDict } from "../../../reducers/inline-dict";
+import store from "../../../store";
+import { lookup } from "../../../reducers/command";
 
 interface IWFMI {
   pali: string;
@@ -19,7 +21,7 @@ interface IWFMI {
 const WbwFactorMeaningItem = ({ pali, meaning, onChange }: IWFMI) => {
   const defaultMenu: MenuProps["items"] = [
     {
-      key: "lookup",
+      key: "_lookup",
       label: (
         <Space>
           <SearchOutlined />
@@ -64,7 +66,9 @@ const WbwFactorMeaningItem = ({ pali, meaning, onChange }: IWFMI) => {
       menu={{
         items: items,
         onClick: (e) => {
-          if (typeof onChange !== "undefined") {
+          if (e.key === "_lookup") {
+            store.dispatch(lookup(pali));
+          } else if (typeof onChange !== "undefined") {
             onChange(e.key);
           }
         },