Browse Source

clean code

reiji-h 2 years ago
parent
commit
c7bf935fe5

+ 4 - 7
apps/app/src/components/PageControls/PageControls.tsx

@@ -112,7 +112,6 @@ type PageControlsSubstanceProps = CommonProps & {
   pageInfo: IPageInfoForOperation,
   pageInfo: IPageInfoForOperation,
   expandContentWidth?: boolean,
   expandContentWidth?: boolean,
   onClickEditTagsButton: () => void,
   onClickEditTagsButton: () => void,
-  isCollapse?: boolean,
 }
 }
 
 
 const PageControlsSubstance = (props: PageControlsSubstanceProps): JSX.Element => {
 const PageControlsSubstance = (props: PageControlsSubstanceProps): JSX.Element => {
@@ -121,7 +120,6 @@ const PageControlsSubstance = (props: PageControlsSubstanceProps): JSX.Element =
     pageId, revisionId, path, shareLinkId, expandContentWidth,
     pageId, revisionId, path, shareLinkId, expandContentWidth,
     disableSeenUserInfoPopover, showPageControlDropdown, forceHideMenuItems, additionalMenuItemRenderer,
     disableSeenUserInfoPopover, showPageControlDropdown, forceHideMenuItems, additionalMenuItemRenderer,
     onClickEditTagsButton, onClickDuplicateMenuItem, onClickRenameMenuItem, onClickDeleteMenuItem, onClickSwitchContentWidth,
     onClickEditTagsButton, onClickDuplicateMenuItem, onClickRenameMenuItem, onClickDeleteMenuItem, onClickSwitchContentWidth,
-    isCollapse,
   } = props;
   } = props;
 
 
   const { data: isGuestUser } = useIsGuestUser();
   const { data: isGuestUser } = useIsGuestUser();
@@ -252,7 +250,6 @@ const PageControlsSubstance = (props: PageControlsSubstanceProps): JSX.Element =
   ];
   ];
 
 
   const isViewMode = editorMode === EditorMode.View;
   const isViewMode = editorMode === EditorMode.View;
-  const isDeviceIsSp = isDeviceLargerThanMd || !isCollapse;
 
 
   return (
   return (
     <div className={`grw-page-controls ${styles['grw-page-controls']} d-flex`} style={{ gap: '2px' }}>
     <div className={`grw-page-controls ${styles['grw-page-controls']} d-flex`} style={{ gap: '2px' }}>
@@ -264,13 +261,13 @@ const PageControlsSubstance = (props: PageControlsSubstanceProps): JSX.Element =
           onClickEditTagsButton={onClickEditTagsButton}
           onClickEditTagsButton={onClickEditTagsButton}
         />
         />
       )}
       )}
-      { isDeviceIsSp && revisionId != null && (
+      { revisionId != null && (
         <SubscribeButton
         <SubscribeButton
           status={pageInfo.subscriptionStatus}
           status={pageInfo.subscriptionStatus}
           onClick={subscribeClickhandler}
           onClick={subscribeClickhandler}
         />
         />
       )}
       )}
-      {isDeviceIsSp && revisionId != null && (
+      { revisionId != null && (
         <LikeButtons
         <LikeButtons
           onLikeClicked={likeClickhandler}
           onLikeClicked={likeClickhandler}
           sumOfLikers={sumOfLikers}
           sumOfLikers={sumOfLikers}
@@ -278,14 +275,14 @@ const PageControlsSubstance = (props: PageControlsSubstanceProps): JSX.Element =
           likers={likers}
           likers={likers}
         />
         />
       )}
       )}
-      {isDeviceIsSp && revisionId != null && (
+      { revisionId != null && (
         <BookmarkButtons
         <BookmarkButtons
           pageId={pageId}
           pageId={pageId}
           isBookmarked={pageInfo.isBookmarked}
           isBookmarked={pageInfo.isBookmarked}
           bookmarkCount={pageInfo.bookmarkCount}
           bookmarkCount={pageInfo.bookmarkCount}
         />
         />
       )}
       )}
-      {isDeviceIsSp && revisionId != null && (
+      { revisionId != null && (
         <SeenUserInfo
         <SeenUserInfo
           seenUsers={seenUsers}
           seenUsers={seenUsers}
           sumOfSeenUsers={sumOfSeenUsers}
           sumOfSeenUsers={sumOfSeenUsers}

+ 3 - 3
apps/app/src/pages/[[...path]].page.tsx

@@ -19,7 +19,6 @@ import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
 import dynamic from 'next/dynamic';
 import dynamic from 'next/dynamic';
 import Head from 'next/head';
 import Head from 'next/head';
 import { useRouter } from 'next/router';
 import { useRouter } from 'next/router';
-import Sticky from 'react-stickynode';
 import superjson from 'superjson';
 import superjson from 'superjson';
 
 
 import { useEditorModeClassName } from '~/client/services/layout';
 import { useEditorModeClassName } from '~/client/services/layout';
@@ -329,9 +328,10 @@ const Page: NextPageWithLayout<Props> = (props: Props) => {
         <title>{title}</title>
         <title>{title}</title>
       </Head>
       </Head>
       <div className="dynamic-layout-root justify-content-between">
       <div className="dynamic-layout-root justify-content-between">
-        <div className="sticky-top">
+        <nav className="sticky-top">
           <GrowiContextualSubNavigation isLinkSharingDisabled={props.disableLinkSharing} />
           <GrowiContextualSubNavigation isLinkSharingDisabled={props.disableLinkSharing} />
-        </div>
+        </nav>
+
         <DisplaySwitcher
         <DisplaySwitcher
           pageView={(
           pageView={(
             <PageView
             <PageView

+ 3 - 8
apps/app/src/pages/share/[[...path]].page.tsx

@@ -6,7 +6,6 @@ import type {
 } from 'next';
 } from 'next';
 import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
 import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
 import Head from 'next/head';
 import Head from 'next/head';
-import Sticky from 'react-stickynode';
 import superjson from 'superjson';
 import superjson from 'superjson';
 
 
 import { ShareLinkLayout } from '~/components/Layout/ShareLinkLayout';
 import { ShareLinkLayout } from '~/components/Layout/ShareLinkLayout';
@@ -121,13 +120,9 @@ const SharedPage: NextPageWithLayout<Props> = (props: Props) => {
       </Head>
       </Head>
 
 
       <div className="dynamic-layout-root justify-content-between">
       <div className="dynamic-layout-root justify-content-between">
-
-        <div className="sticky-top">
-          <GrowiContextualSubNavigationForSharedPage
-            page={currentPage ?? props.shareLinkRelatedPage}
-            isLinkSharingDisabled={props.disableLinkSharing}
-          />
-        </div>
+        <nav className="sticky-top">
+          <GrowiContextualSubNavigationForSharedPage page={currentPage ?? props.shareLinkRelatedPage} isLinkSharingDisabled={props.disableLinkSharing} />
+        </nav>
 
 
         <div id="grw-fav-sticky-trigger" className="sticky-top"></div>
         <div id="grw-fav-sticky-trigger" className="sticky-top"></div>