Explorar o código

Merge pull request #3003 from weseek/feat/gw-4295-add-message-in-timeline-of-not-found-page

add message in timeline when the page does not have children pages
Yuki Takei %!s(int64=5) %!d(string=hai) anos
pai
achega
b1246f7330
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      src/client/js/components/PageTimeline.jsx

+ 8 - 1
src/client/js/components/PageTimeline.jsx

@@ -60,9 +60,16 @@ class PageTimeline extends React.Component {
   }
 
   render() {
+    const { t } = this.props;
     const { pages } = this.state;
+    const { path } = this.props.pageContainer.state;
     if (pages == null || pages.length === 0) {
-      return <React.Fragment></React.Fragment>;
+      return (
+        <div className="mt-2">
+          {/* eslint-disable-next-line react/no-danger */}
+          <p dangerouslySetInnerHTML={{ __html: t('custom_navigation.no_page_list', { path }) }} />
+        </div>
+      );
     }
 
     return (