diff --git a/frontend/src/i18n.ts b/frontend/src/i18n.ts index f5be7e5..55352db 100644 --- a/frontend/src/i18n.ts +++ b/frontend/src/i18n.ts @@ -202,6 +202,8 @@ export const i18nData = { "Optionally, you can specify a type for the new tags.": "Optionally, you can specify a type for the new tags.", "Upload Clipboard Image": "Upload Clipboard Image", + "Show more": "Show more", + "Show less": "Show less", }, }, "zh-CN": { @@ -396,6 +398,8 @@ export const i18nData = { "Optionally, you can specify a type for the new tags.": "您可以选择为新标签指定一个类型。", "Upload Clipboard Image": "上传剪贴板图片", + "Show more": "显示更多", + "Show less": "显示更少", }, }, "zh-TW": { @@ -590,6 +594,8 @@ export const i18nData = { "Optionally, you can specify a type for the new tags.": "您可以選擇為新標籤指定一個類型。", "Upload Clipboard Image": "上傳剪貼板圖片", + "Show more": "顯示更多", + "Show less": "顯示更少", }, }, }; diff --git a/frontend/src/pages/resource_details_page.tsx b/frontend/src/pages/resource_details_page.tsx index 7f945db..442fda8 100644 --- a/frontend/src/pages/resource_details_page.tsx +++ b/frontend/src/pages/resource_details_page.tsx @@ -23,7 +23,7 @@ import Markdown from "react-markdown"; import "../markdown.css"; import Loading from "../components/loading.tsx"; import { - MdAdd, + MdAdd, MdArrowDownward, MdArrowUpward, MdOutlineArticle, MdOutlineComment, MdOutlineDataset, @@ -360,11 +360,12 @@ function Article({ resource }: { resource: ResourceDetails }) { > ); } - // @ts-ignore } else if ( typeof props.children === "object" && - props.children.props && - props.children.props.href + // @ts-ignore + props.children?.props && + // @ts-ignore + props.children?.props.href ) { const a = props.children as ReactElement; const childProps = a.props as any; @@ -1140,11 +1141,11 @@ function Comments({ resourceId }: { resourceId: number }) { maxPageCallback={setMaxPage} key={listKey} /> - {maxPage && ( + {maxPage ? (