Yuki Takei 2 лет назад
Родитель
Сommit
7ca8722287

+ 21 - 10
apps/app/src/components/Common/PageViewLayout.module.scss

@@ -3,17 +3,18 @@
 @use '~/styles/variables' as var;
 @use '~/styles/variables' as var;
 
 
 
 
+$subnavigation-height: 50px;
+$page-view-layout-margin-top: 32px;
+
 .page-view-layout :global {
 .page-view-layout :global {
-  min-height: calc(100vh - 48px - 250px); // 100vh - subnavigation height - page-comments-row minimum height
+  $page-content-footer-min-heigh: 130px;
 
 
-  .grw-side-contents-container {
-    margin-bottom: 1rem;
+  display: flex;
+  flex-direction: column;
+  min-height: calc(100vh - #{$subnavigation-height + $page-view-layout-margin-top + $page-content-footer-min-heigh});
 
 
-    @include bs.media-breakpoint-up(lg) {
-      width: 250px;
-      min-width: 250px;
-      margin-left: 30px;
-    }
+  .content-main {
+    flex-grow: 1;
   }
   }
 }
 }
 
 
@@ -24,13 +25,23 @@
   }
   }
 }
 }
 
 
+.page-view-layout :global {
+  .grw-side-contents-container {
+    margin-bottom: 1rem;
+
+    @include bs.media-breakpoint-up(lg) {
+      width: 250px;
+      min-width: 250px;
+      margin-left: 30px;
+    }
+  }
+}
+
 // sticky side contents
 // sticky side contents
 .page-view-layout :global {
 .page-view-layout :global {
   .grw-side-contents-sticky-container {
   .grw-side-contents-sticky-container {
     position: sticky;
     position: sticky;
 
 
-    $subnavigation-height: 50px;
-    $page-view-layout-margin-top: 32px;
     $page-path-nav-height: 99px;
     $page-path-nav-height: 99px;
     top: calc($subnavigation-height + $page-view-layout-margin-top + $page-path-nav-height + 4px);
     top: calc($subnavigation-height + $page-view-layout-margin-top + $page-path-nav-height + 4px);
   }
   }

+ 5 - 2
apps/app/src/components/Common/PageViewLayout.tsx

@@ -2,6 +2,9 @@ import type { ReactNode } from 'react';
 
 
 import styles from './PageViewLayout.module.scss';
 import styles from './PageViewLayout.module.scss';
 
 
+const pageViewLayoutClass = styles['page-view-layout'] ?? '';
+const footerLayoutClass = styles['footer-layout'] ?? '';
+
 type Props = {
 type Props = {
   children?: ReactNode,
   children?: ReactNode,
   headerContents?: ReactNode,
   headerContents?: ReactNode,
@@ -16,7 +19,7 @@ export const PageViewLayout = (props: Props): JSX.Element => {
 
 
   return (
   return (
     <>
     <>
-      <div id="main" className={`main ${styles['page-view-layout']}`}>
+      <div id="main" className={`main ${pageViewLayoutClass}`}>
         <div id="content-main" className="content-main container-lg grw-container-convertible">
         <div id="content-main" className="content-main container-lg grw-container-convertible">
           { headerContents != null && headerContents }
           { headerContents != null && headerContents }
           { sideContents != null
           { sideContents != null
@@ -40,7 +43,7 @@ export const PageViewLayout = (props: Props): JSX.Element => {
       </div>
       </div>
 
 
       { footerContents != null && (
       { footerContents != null && (
-        <footer className="footer d-edit-none">
+        <footer className={`footer d-edit-none ${footerLayoutClass}`}>
           {footerContents}
           {footerContents}
         </footer>
         </footer>
       ) }
       ) }

+ 16 - 10
apps/app/src/components/Page/PageView.tsx

@@ -112,14 +112,6 @@ export const PageView = (props: Props): JSX.Element => {
   const footerContents = !isIdenticalPathPage && !isNotFound
   const footerContents = !isIdenticalPathPage && !isNotFound
     ? (
     ? (
       <>
       <>
-        <div id="comments-container" ref={commentsContainerRef}>
-          <Comments
-            pageId={page._id}
-            pagePath={pagePath}
-            revision={page.revision}
-            onLoaded={() => setCommentsLoaded(true)}
-          />
-        </div>
         {(isUsersHomepagePath && page.creator != null) && (
         {(isUsersHomepagePath && page.creator != null) && (
           <UsersHomepageFooter creatorId={page.creator._id} />
           <UsersHomepageFooter creatorId={page.creator._id} />
         )}
         )}
@@ -139,7 +131,21 @@ export const PageView = (props: Props): JSX.Element => {
     return (
     return (
       <>
       <>
         <PageContentsUtilities />
         <PageContentsUtilities />
-        <RevisionRenderer rendererOptions={rendererOptions} markdown={markdown} />
+
+        <div>
+          <RevisionRenderer rendererOptions={rendererOptions} markdown={markdown} />
+
+          { !isIdenticalPathPage && !isNotFound && (
+            <div id="comments-container" ref={commentsContainerRef}>
+              <Comments
+                pageId={page._id}
+                pagePath={pagePath}
+                revision={page.revision}
+                onLoaded={() => setCommentsLoaded(true)}
+              />
+            </div>
+          ) }
+        </div>
       </>
       </>
     );
     );
   };
   };
@@ -156,7 +162,7 @@ export const PageView = (props: Props): JSX.Element => {
       {specialContents == null && (
       {specialContents == null && (
         <>
         <>
           {(isUsersHomepagePath && page?.creator != null) && <UserInfo author={page.creator} />}
           {(isUsersHomepagePath && page?.creator != null) && <UserInfo author={page.creator} />}
-          <div className={`mb-5 ${isMobile ? `page-mobile ${styles['page-mobile']}` : ''}`}>
+          <div className={`${isMobile ? `page-mobile ${styles['page-mobile']}` : ''}`}>
             <Contents />
             <Contents />
           </div>
           </div>
         </>
         </>