Parcourir la source

use props data not swr

kaori il y a 3 ans
Parent
commit
658be9e86c
1 fichiers modifiés avec 1 ajouts et 3 suppressions
  1. 1 3
      packages/app/src/components/Navbar/GrowiSubNavigation.tsx

+ 1 - 3
packages/app/src/components/Navbar/GrowiSubNavigation.tsx

@@ -2,7 +2,6 @@ import React from 'react';
 
 import { IPageHasId } from '~/interfaces/page';
 import { IUser } from '~/interfaces/user';
-import { useCurrentPagePath } from '~/stores/context';
 import {
   EditorMode, useEditorMode,
 } from '~/stores/ui';
@@ -34,7 +33,6 @@ type Props = {
 
 export const GrowiSubNavigation = (props: Props): JSX.Element => {
   const { data: editorMode } = useEditorMode();
-  const { data: currentPath } = useCurrentPagePath();
 
   const {
     page,
@@ -74,7 +72,7 @@ export const GrowiSubNavigation = (props: Props): JSX.Element => {
 
         <div className="grw-path-nav-container">
           {/* "/trash" page does not exist on page collection and unable to add tags  */}
-          { showTagLabel && !isCompactMode && currentPath !== '/trash' && (
+          { showTagLabel && !isCompactMode && path !== '/trash' && (
             <div className="grw-taglabels-container">
               <TagLabels tags={tags} isGuestUser={isGuestUser ?? false} tagsUpdateInvoked={tagsUpdatedHandler} />
             </div>