|
|
@@ -13,6 +13,8 @@ import LikeButton from '../LikeButton';
|
|
|
import BookmarkButton from '../BookmarkButton';
|
|
|
import PageCreator from './PageCreator';
|
|
|
import RevisionAuthor from './RevisionAuthor';
|
|
|
+import ReducedPageCreator from './ReducedPageCreator';
|
|
|
+import ReducedRevisionAuthor from './ReducedRevisionAuthor';
|
|
|
|
|
|
const GrowiSubNavigation = (props) => {
|
|
|
const isPageForbidden = document.querySelector('#grw-subnav').getAttribute('data-is-forbidden-page');
|
|
|
@@ -20,7 +22,10 @@ const GrowiSubNavigation = (props) => {
|
|
|
const {
|
|
|
path, createdAt, creator, updatedAt, revisionAuthor,
|
|
|
} = pageContainer.state;
|
|
|
-
|
|
|
+ const isTopBarVisible = window.addEventListener('scroll', () => {
|
|
|
+ console.log(window.pageYOffset);
|
|
|
+ return window.pageYOffset > 122;
|
|
|
+ });
|
|
|
// Display only the RevisionPath if the page is trash or forbidden
|
|
|
if (isTrashPage(path) || isPageForbidden) {
|
|
|
return (
|
|
|
@@ -35,35 +40,60 @@ const GrowiSubNavigation = (props) => {
|
|
|
}
|
|
|
|
|
|
return (
|
|
|
- <div className="d-flex align-items-center">
|
|
|
+ <div>
|
|
|
+ <div className="d-flex align-items-center fixed-top grw-compact-subnavbar px-3">
|
|
|
|
|
|
- {/* Page Path */}
|
|
|
- <div className="title-container mr-auto">
|
|
|
- <h1>
|
|
|
- <RevisionPath behaviorType={appContainer.config.behaviorType} pageId={pageContainer.state.pageId} pagePath={pageContainer.state.path} />
|
|
|
- </h1>
|
|
|
- <TagLabels />
|
|
|
- </div>
|
|
|
+ {/* Page Path */}
|
|
|
+ <div className="title-container mr-auto">
|
|
|
+ <h2>
|
|
|
+ <RevisionPath behaviorType={appContainer.config.behaviorType} pageId={pageContainer.state.pageId} pagePath={pageContainer.state.path} />
|
|
|
+ </h2>
|
|
|
+ <TagLabels />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {/* Header Button */}
|
|
|
+ <div className="ml-1">
|
|
|
+ <LikeButton pageId={pageContainer.state.pageId} isLiked={pageContainer.state.isLiked} />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <BookmarkButton pageId={pageContainer.state.pageId} crowi={appContainer} />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {/* Page Authors */}
|
|
|
+ <ul className="authors text-nowrap d-none d-lg-block">
|
|
|
+ {creator != null && <li><ReducedPageCreator creator={creator} createdAt={createdAt} /></li>}
|
|
|
+ {revisionAuthor != null && <li className="mt-1"><ReducedRevisionAuthor revisionAuthor={revisionAuthor} updatedAt={updatedAt} /></li>}
|
|
|
+ </ul>
|
|
|
|
|
|
- {/* Header Button */}
|
|
|
- <div className="ml-1">
|
|
|
- <LikeButton pageId={pageContainer.state.pageId} isLiked={pageContainer.state.isLiked} />
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <BookmarkButton pageId={pageContainer.state.pageId} crowi={appContainer} />
|
|
|
</div>
|
|
|
+ <div className="d-flex align-items-center">
|
|
|
+ {/* Page Path */}
|
|
|
+ <div className="title-container mr-auto">
|
|
|
+ <h1>
|
|
|
+ <RevisionPath behaviorType={appContainer.config.behaviorType} pageId={pageContainer.state.pageId} pagePath={pageContainer.state.path} />
|
|
|
+ </h1>
|
|
|
+ <TagLabels />
|
|
|
+ </div>
|
|
|
|
|
|
- {/* Page Authors */}
|
|
|
- <ul className="authors text-nowrap d-none d-lg-block">
|
|
|
- {creator != null && <li><PageCreator creator={creator} createdAt={createdAt} /></li>}
|
|
|
- {revisionAuthor != null && <li className="mt-1"><RevisionAuthor revisionAuthor={revisionAuthor} updatedAt={updatedAt} /></li>}
|
|
|
- </ul>
|
|
|
+ {/* Header Button */}
|
|
|
+ <div className="ml-1">
|
|
|
+ <LikeButton pageId={pageContainer.state.pageId} isLiked={pageContainer.state.isLiked} />
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <BookmarkButton pageId={pageContainer.state.pageId} crowi={appContainer} />
|
|
|
+ </div>
|
|
|
|
|
|
+ {/* Page Authors */}
|
|
|
+ <ul className="authors text-nowrap d-none d-lg-block">
|
|
|
+ {creator != null && <li><PageCreator creator={creator} createdAt={createdAt} /></li>}
|
|
|
+ {revisionAuthor != null && <li className="mt-1"><RevisionAuthor revisionAuthor={revisionAuthor} updatedAt={updatedAt} /></li>}
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
);
|
|
|
-
|
|
|
};
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* Wrapper component for using unstated
|
|
|
*/
|