visuddhinanda 3 лет назад
Родитель
Сommit
8267fb3348

+ 6 - 1
dashboard/src/components/template/SentEdit.tsx

@@ -22,7 +22,12 @@ export interface ISentence {
   updateAt: string;
   updateAt: string;
   suggestionCount?: ISuggestionCount;
   suggestionCount?: ISuggestionCount;
 }
 }
-
+export interface ISentenceId {
+  book: number;
+  para: number;
+  wordStart: number;
+  wordEnd: number;
+}
 export interface IWidgetSentEditInner {
 export interface IWidgetSentEditInner {
   id: string;
   id: string;
   channels?: string[];
   channels?: string[];

+ 7 - 1
dashboard/src/components/template/SentEdit/SentContent.tsx

@@ -56,7 +56,13 @@ const Widget = ({
     }
     }
   }, [newMode]);
   }, [newMode]);
   return (
   return (
-    <div style={{ display: "flex", flexDirection: layoutDirection }}>
+    <div
+      style={{
+        display: "flex",
+        flexDirection: layoutDirection,
+        marginBottom: 10,
+      }}
+    >
       <div style={{ flex: layoutFlex.left, color: "#9f3a01" }}>
       <div style={{ flex: layoutFlex.left, color: "#9f3a01" }}>
         {origin?.map((item, id) => {
         {origin?.map((item, id) => {
           if (item.channel.type === "wbw") {
           if (item.channel.type === "wbw") {

+ 15 - 2
dashboard/src/components/template/SentRead.tsx

@@ -11,6 +11,8 @@ import { GetUserSetting } from "../auth/setting/default";
 import { TCodeConvertor } from "./utilities";
 import { TCodeConvertor } from "./utilities";
 import { ISentence } from "./SentEdit";
 import { ISentence } from "./SentEdit";
 import MdView from "./MdView";
 import MdView from "./MdView";
+import store from "../../store";
+import { push } from "../../reducers/sentence";
 
 
 interface IWidgetSentReadFrame {
 interface IWidgetSentReadFrame {
   origin?: ISentence[];
   origin?: ISentence[];
@@ -30,7 +32,15 @@ const SentReadFrame = ({
   const settings = useAppSelector(settingInfo);
   const settings = useAppSelector(settingInfo);
   const boxOrg = useRef<HTMLDivElement>(null);
   const boxOrg = useRef<HTMLDivElement>(null);
   const boxSent = useRef<HTMLDivElement>(null);
   const boxSent = useRef<HTMLDivElement>(null);
-
+  useEffect(() => {
+    if (origin && origin.length > 0) {
+      store.dispatch(
+        push(
+          `${origin[0].book}-${origin[0].para}-${origin[0].wordStart}-${origin[0].wordEnd}`
+        )
+      );
+    }
+  }, [origin]);
   useEffect(() => {
   useEffect(() => {
     const displayOriginal = GetUserSetting(
     const displayOriginal = GetUserSetting(
       "setting.display.original",
       "setting.display.original",
@@ -70,7 +80,10 @@ const SentReadFrame = ({
         </Button>
         </Button>
       }
       }
     >
     >
-      <div style={{ display: "flex", flexDirection: layout }} ref={boxSent}>
+      <div
+        style={{ display: "flex", flexDirection: layout, marginBottom: 10 }}
+        ref={boxSent}
+      >
         <div style={{ flex: "5", color: "#9f3a01" }} ref={boxOrg}>
         <div style={{ flex: "5", color: "#9f3a01" }} ref={boxOrg}>
           {origin?.map((item, id) => {
           {origin?.map((item, id) => {
             return (
             return (