visuddhinanda 2 лет назад
Родитель
Сommit
6606366162

+ 16 - 17
dashboard/src/components/template/Wbw/WbwPali.tsx

@@ -94,13 +94,13 @@ const WbwPaliWidget = ({ data, display, onSave }: IWidget) => {
     />
   );
 
-  const noteIcon = data.note ? (
-    <Popover content={data.note.value} placement="bottom">
-      <InfoCircleOutlined style={{ color: "blue" }} />
-    </Popover>
-  ) : (
-    <></>
-  );
+  const noteIcon = data.note?.value ? (
+    data.note.value.trim() !== "" ? (
+      <Popover content={data.note?.value} placement="bottom">
+        <InfoCircleOutlined style={{ color: "blue" }} />
+      </Popover>
+    ) : undefined
+  ) : undefined;
   const color = data.bookMarkColor?.value
     ? bookMarkColor[data.bookMarkColor.value]
     : "white";
@@ -125,16 +125,15 @@ const WbwPaliWidget = ({ data, display, onSave }: IWidget) => {
     <ApartmentOutlined style={{ color: "blue" }} />
   ) : undefined;
 
-  const bookMarkIcon = data.bookMarkText ? (
-    <Popover
-      content={<Paragraph copyable>{data.bookMarkText.value}</Paragraph>}
-      placement="bottom"
-    >
-      <TagTwoTone twoToneColor={color} />
-    </Popover>
-  ) : (
-    <></>
-  );
+  const bookMarkIcon =
+    data.bookMarkText?.value && data.bookMarkText.value.trim() !== "" ? (
+      <Popover
+        content={<Paragraph copyable>{data.bookMarkText.value}</Paragraph>}
+        placement="bottom"
+      >
+        <TagTwoTone twoToneColor={color} />
+      </Popover>
+    ) : undefined;
   const classPali = data.style?.value === "note" ? "wbw_note" : "pali";
   let padding: string;
   if (typeof data.real !== "undefined" && data.real.value !== "") {

+ 2 - 2
dashboard/src/components/template/Wbw/WbwParent2.tsx

@@ -7,8 +7,8 @@ interface IWidget {
 }
 const WbwParent2Widget = ({ data }: IWidget) => {
   const intl = useIntl();
-  return data.grammar2 ? (
-    data.grammar2.value !== "" ? (
+  return data.grammar2?.value ? (
+    data.grammar2.value.trim() !== "" ? (
       <Tooltip title={data.parent2?.value}>
         <Tag color={"yellow"}>
           {intl.formatMessage({