Browse Source

add textType

visuddhinanda 1 year ago
parent
commit
8d3ea6fe66
1 changed files with 12 additions and 1 deletions
  1. 12 1
      dashboard/src/components/template/Wbw/PaliText.tsx

+ 12 - 1
dashboard/src/components/template/Wbw/PaliText.tsx

@@ -13,6 +13,7 @@ import { roman_to_thai } from "../../code/thai";
 import { roman_to_taitham } from "../../code/tai-tham";
 import { roman_to_taitham } from "../../code/tai-tham";
 import store from "../../../store";
 import store from "../../../store";
 import { lookup as _lookup } from "../../../reducers/command";
 import { lookup as _lookup } from "../../../reducers/command";
+import { BaseType } from "antd/lib/typography/Base";
 
 
 const { Text } = Typography;
 const { Text } = Typography;
 
 
@@ -23,6 +24,7 @@ interface IWidget {
   primary?: boolean;
   primary?: boolean;
   termToLocal?: boolean;
   termToLocal?: boolean;
   lookup?: boolean;
   lookup?: boolean;
+  textType?: BaseType;
 }
 }
 const PaliTextWidget = ({
 const PaliTextWidget = ({
   text,
   text,
@@ -31,6 +33,7 @@ const PaliTextWidget = ({
   primary = true,
   primary = true,
   termToLocal = true,
   termToLocal = true,
   lookup = false,
   lookup = false,
+  textType,
 }: IWidget) => {
 }: IWidget) => {
   const [paliText, setPaliText] = useState<string>();
   const [paliText, setPaliText] = useState<string>();
   const settings = useAppSelector(settingInfo);
   const settings = useAppSelector(settingInfo);
@@ -90,11 +93,19 @@ const PaliTextWidget = ({
     }
     }
   }, [text, settings, code]);
   }, [text, settings, code]);
 
 
-  const nodePali = text ? <Text style={style}>{paliText}</Text> : <></>;
+  const nodePali = text ? (
+    <Text type={textType} style={style}>
+      {paliText}
+    </Text>
+  ) : (
+    <></>
+  );
+
   if (lookup) {
   if (lookup) {
     return (
     return (
       <Typography.Text
       <Typography.Text
         style={{ cursor: "pointer" }}
         style={{ cursor: "pointer" }}
+        type={textType}
         onClick={() => {
         onClick={() => {
           //发送点词查询消息
           //发送点词查询消息
           if (typeof romanText === "string") {
           if (typeof romanText === "string") {