Browse Source

add isUserPage

zahmis 5 years ago
parent
commit
8e11f227da
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/client/js/components/TableOfContents.jsx

+ 3 - 1
src/client/js/components/TableOfContents.jsx

@@ -23,6 +23,8 @@ const logger = loggerFactory('growi:TableOfContents');
 const TableOfContents = (props) => {
 
   const { pageContainer, navigationContainer } = props;
+  const { pageUser } = pageContainer.state;
+  const isUserPage = pageUser != null;
 
   const calcViewHeight = useCallback(() => {
     // calculate absolute top of '#revision-toc' element
@@ -60,7 +62,7 @@ const TableOfContents = (props) => {
         />
       </StickyStretchableScroller>
 
-      { props.isUser && (
+      { isUserPage && (
       <div className="mt-3 d-flex justify-content-around">
         <a className="btn btn-outline-secondary btn-sm" href="#">
           <i className="mr-2 icon-star"></i>