Parcourir la source

Merge pull request #2313 from visuddhinanda/development

Development
visuddhinanda il y a 9 mois
Parent
commit
3a3de136f0

+ 1 - 1
api-v8/app/Http/Api/TemplateRender.php

@@ -535,7 +535,7 @@ class TemplateRender
         $innerString = "";
         $props = [
             "pali" => $pali,
-            "meaning" => $meaning,
+            "meaning" => explode('=', $meaning),
             "lang" => $this->lang,
         ];
         switch ($this->format) {

+ 31 - 0
dashboard-v4/dashboard/src/assets/icon/index.tsx

@@ -871,6 +871,33 @@ const GroupSvg = () => (
     ></path>
   </svg>
 );
+
+const MoreSvg = () => (
+  <svg
+    viewBox="0 0 1024 1024"
+    version="1.1"
+    xmlns="http://www.w3.org/2000/svg"
+    p-id="5057"
+    width="1em"
+    height="1em"
+  >
+    <path
+      d="M227.14123 413.647995c-52.14973 0-94.587262 42.439578-94.587262 94.587262 0 52.14973 42.437531 94.587262 94.587262 94.587262 52.147684 0 94.587262-42.437531 94.587262-94.587262C321.728492 456.087573 279.288914 413.647995 227.14123 413.647995z"
+      fill="currentColor"
+      p-id="5058"
+    ></path>
+    <path
+      d="M510.903016 413.647995c-52.14973 0-94.587262 42.439578-94.587262 94.587262 0 52.14973 42.437531 94.587262 94.587262 94.587262 52.147684 0 94.587262-42.437531 94.587262-94.587262C605.490278 456.087573 563.051723 413.647995 510.903016 413.647995z"
+      fill="currentColor"
+      p-id="5059"
+    ></path>
+    <path
+      d="M794.665825 413.647995c-52.14973 0-94.587262 42.439578-94.587262 94.587262 0 52.14973 42.437531 94.587262 94.587262 94.587262 52.147684 0 94.587262-42.437531 94.587262-94.587262C889.253086 456.087573 846.813508 413.647995 794.665825 413.647995z"
+      fill="currentColor"
+      p-id="5060"
+    ></path>
+  </svg>
+);
 export const DictIcon = (props: Partial<CustomIconComponentProps>) => (
   <Icon component={DictSvg} {...props} />
 );
@@ -1039,3 +1066,7 @@ export const SortIcon = (props: Partial<CustomIconComponentProps>) => (
 export const GroupIcon = (props: Partial<CustomIconComponentProps>) => (
   <Icon component={GroupSvg} {...props} />
 );
+
+export const MoreIcon = (props: Partial<CustomIconComponentProps>) => (
+  <Icon component={MoreSvg} {...props} />
+);

+ 21 - 2
dashboard-v4/dashboard/src/components/template/Nissaya.tsx

@@ -1,12 +1,14 @@
+import { Popover } from "antd";
 import { useAppSelector } from "../../hooks";
 import { settingInfo } from "../../reducers/setting";
 import { GetUserSetting } from "../auth/setting/default";
 import NissayaMeaning from "./Nissaya/NissayaMeaning";
 import PaliText from "./Wbw/PaliText";
+import { MoreIcon } from "../../assets/icon";
 
 interface IWidgetNissayaCtl {
   pali?: string;
-  meaning?: string;
+  meaning?: string[];
   lang?: string;
   children?: React.ReactNode | React.ReactNode[];
 }
@@ -16,6 +18,10 @@ const NissayaCtl = ({ pali, meaning, lang, children }: IWidgetNissayaCtl) => {
   console.debug("NissayaCtl layout", layout);
   const isArray = Array.isArray(children);
   const meaning2 = isArray ? children[1] : "";
+  const show = -1;
+  const ect = meaning
+    ?.slice(0, -1)
+    .map((item, id) => <NissayaMeaning key={id} text={item} />);
   return (
     <span
       style={{
@@ -30,7 +36,20 @@ const NissayaCtl = ({ pali, meaning, lang, children }: IWidgetNissayaCtl) => {
         termToLocal={false}
         style={{ fontWeight: 700 }}
       />{" "}
-      {lang === "my" ? <NissayaMeaning text={meaning} /> : <>{meaning2}</>}
+      {ect && ect?.length > 0 ? (
+        <Popover content={ect}>
+          <MoreIcon />{" "}
+        </Popover>
+      ) : (
+        <></>
+      )}
+      {lang === "my" ? (
+        meaning
+          ?.slice(-1)
+          .map((item, id) => <NissayaMeaning key={id} text={item} />)
+      ) : (
+        <>{meaning2}</>
+      )}
     </span>
   );
 };