فهرست منبع

add focus on TypePage

visuddhinanda 2 سال پیش
والد
کامیت
cf9df22b10

+ 1 - 0
dashboard/src/components/article/Article.tsx

@@ -141,6 +141,7 @@ const ArticleWidget = ({
         <TypePage
           articleId={articleId}
           channelId={channelId}
+          focus={focus}
           mode={mode}
           onArticleChange={(type: ArticleType, id: string) => {
             if (typeof onArticleChange !== "undefined") {

+ 3 - 0
dashboard/src/components/article/TypePage.tsx

@@ -22,6 +22,7 @@ interface IWidget {
   articleId?: string;
   mode?: ArticleMode | null;
   channelId?: string | null;
+  focus?: string | null;
   onArticleChange?: Function;
   onFinal?: Function;
   onLoad?: Function;
@@ -29,6 +30,7 @@ interface IWidget {
 const TypeTermWidget = ({
   channelId,
   articleId,
+  focus,
   mode = "read",
   onArticleChange,
 }: IWidget) => {
@@ -101,6 +103,7 @@ const TypeTermWidget = ({
           <TypePali
             type={"para"}
             {...paramPali}
+            focus={focus}
             onArticleChange={(type: ArticleType, id: string) => {
               if (typeof onArticleChange !== "undefined") {
                 onArticleChange(type, id);

+ 3 - 0
dashboard/src/components/template/Article.tsx

@@ -13,6 +13,7 @@ interface IWidgetChapterCtl {
   id?: string;
   channel?: string;
   title?: string;
+  focus?: string | null;
   style?: TDisplayStyle;
 }
 
@@ -21,6 +22,7 @@ export const ArticleCtl = ({
   id,
   channel,
   title,
+  focus,
   style = "modal",
 }: IWidgetChapterCtl) => {
   const [isModalOpen, setIsModalOpen] = useState(false);
@@ -42,6 +44,7 @@ export const ArticleCtl = ({
       type={type}
       articleId={id}
       channelId={channel}
+      focus={focus}
       mode="read"
     />
   );

+ 3 - 2
dashboard/src/components/template/QuoteLink.tsx

@@ -8,8 +8,8 @@ interface IWidgetQuoteLinkCtl {
   volume: string;
   page: string;
   style: TDisplayStyle;
-  book: number;
-  para: number;
+  book?: number;
+  para?: number;
 }
 const QuoteLinkCtl = ({
   type,
@@ -31,6 +31,7 @@ const QuoteLinkCtl = ({
       <ArticleCtl
         title={textShow}
         type={"page"}
+        focus={book && para ? `${book}-${para}` : undefined}
         id={`${type}_${bookName}_${volume}_${page}`}
         style={style}
       />