Przeglądaj źródła

rename useStaticPageTags to usePageTagsForEditors

kaori 3 lat temu
rodzic
commit
d8ac865314

+ 2 - 2
packages/app/src/components/Navbar/GrowiContextualSubNavigation.tsx

@@ -14,7 +14,7 @@ import {
   useCurrentCreatedAt, useCurrentUpdatedAt, useCurrentPageId, useRevisionId, useCurrentPagePath,
   useCreator, useRevisionAuthor, useCurrentUser, useIsGuestUser, useIsSharedUser, useShareLinkId,
 } from '~/stores/context';
-import { useStaticPageTags } from '~/stores/editor';
+import { usePageTagsForEditors } from '~/stores/editor';
 import {
   usePageAccessoriesModal, PageAccessoriesModalContents, IPageForPageDuplicateModal,
   usePageDuplicateModal, usePageRenameModal, usePageDeleteModal, usePagePresentationModal,
@@ -167,7 +167,7 @@ const GrowiContextualSubNavigation = (props) => {
   const { data: isAbleToShowPageAuthors } = useIsAbleToShowPageAuthors();
 
   const { mutate: mutateSWRTagsInfo, data: tagsInfoData } = useSWRxTagsInfo(pageId);
-  const { data: tagsOnEditMode, mutate: mutateTagsOnEditMode } = useStaticPageTags(tagsInfoData?.tags);
+  const { data: tagsOnEditMode, mutate: mutateTagsOnEditMode } = usePageTagsForEditors(tagsInfoData?.tags);
 
   const { open: openDuplicateModal } = usePageDuplicateModal();
   const { open: openRenameModal } = usePageRenameModal();

+ 2 - 2
packages/app/src/components/Page.jsx

@@ -11,7 +11,7 @@ import { getOptionsToSave } from '~/client/util/editor';
 import {
   useCurrentPagePath, useIsGuestUser, useCurrentPageId,
 } from '~/stores/context';
-import { useSWRxSlackChannels, useIsSlackEnabled, useStaticPageTags } from '~/stores/editor';
+import { useSWRxSlackChannels, useIsSlackEnabled, usePageTagsForEditors } from '~/stores/editor';
 import { useSWRxTagsInfo } from '~/stores/page';
 import {
   useEditorMode, useIsMobile, useSelectedGrant, useSelectedGrantGroupId, useSelectedGrantGroupName,
@@ -193,7 +193,7 @@ const PageWrapper = (props) => {
   const { data: isSlackEnabled } = useIsSlackEnabled();
   const { data: pageId } = useCurrentPageId();
   const { data: tagsInfoData } = useSWRxTagsInfo(pageId);
-  const { data: pageTags } = useStaticPageTags(tagsInfoData?.tags);
+  const { data: pageTags } = usePageTagsForEditors(tagsInfoData?.tags);
   const { data: grant } = useSelectedGrant();
   const { data: grantGroupId } = useSelectedGrantGroupId();
   const { data: grantGroupName } = useSelectedGrantGroupName();

+ 2 - 2
packages/app/src/components/PageEditor.tsx

@@ -17,7 +17,7 @@ import {
   useIsEditable, useIsIndentSizeForced, useCurrentPagePath, useCurrentPageId,
 } from '~/stores/context';
 import {
-  useCurrentIndentSize, useSWRxSlackChannels, useIsSlackEnabled, useIsTextlintEnabled, useStaticPageTags,
+  useCurrentIndentSize, useSWRxSlackChannels, useIsSlackEnabled, useIsTextlintEnabled, usePageTagsForEditors,
 } from '~/stores/editor';
 import { useSWRxTagsInfo } from '~/stores/page';
 import {
@@ -89,7 +89,7 @@ const PageEditor = (props: Props): JSX.Element => {
   const { data: isSlackEnabled } = useIsSlackEnabled();
   const { data: pageId } = useCurrentPageId();
   const { data: tagsInfoData } = useSWRxTagsInfo(pageId);
-  const { data: pageTags } = useStaticPageTags(tagsInfoData?.tags);
+  const { data: pageTags } = usePageTagsForEditors(tagsInfoData?.tags);
   const { data: currentPagePath } = useCurrentPagePath();
   const { data: slackChannelsData } = useSWRxSlackChannels(currentPagePath);
   const { data: grant, mutate: mutateGrant } = useSelectedGrant();

+ 2 - 2
packages/app/src/components/PageEditorByHackmd.jsx

@@ -10,7 +10,7 @@ import PageContainer from '~/client/services/PageContainer';
 import { apiPost } from '~/client/util/apiv1-client';
 import { getOptionsToSave } from '~/client/util/editor';
 import { useCurrentPagePath, useCurrentPageId } from '~/stores/context';
-import { useSWRxSlackChannels, useIsSlackEnabled, useStaticPageTags } from '~/stores/editor';
+import { useSWRxSlackChannels, useIsSlackEnabled, usePageTagsForEditors } from '~/stores/editor';
 import { useSWRxTagsInfo } from '~/stores/page';
 import {
   useEditorMode, useSelectedGrant, useSelectedGrantGroupId, useSelectedGrantGroupName,
@@ -455,7 +455,7 @@ const PageEditorByHackmdWrapper = (props) => {
   const { data: isSlackEnabled } = useIsSlackEnabled();
   const { data: pageId } = useCurrentPageId();
   const { data: tagsInfoData } = useSWRxTagsInfo(pageId);
-  const { data: pageTags } = useStaticPageTags(tagsInfoData?.tags);
+  const { data: pageTags } = usePageTagsForEditors(tagsInfoData?.tags);
   const { data: grant } = useSelectedGrant();
   const { data: grantGroupId } = useSelectedGrantGroupId();
   const { data: grantGroupName } = useSelectedGrantGroupName();

+ 2 - 2
packages/app/src/components/SavePageControls.jsx

@@ -15,7 +15,7 @@ import { getOptionsToSave } from '~/client/util/editor';
 
 // TODO: remove this when omitting unstated is completed
 import { useIsEditable, useCurrentPageId } from '~/stores/context';
-import { useStaticPageTags } from '~/stores/editor';
+import { usePageTagsForEditors } from '~/stores/editor';
 import { useSWRxTagsInfo } from '~/stores/page';
 import {
   useEditorMode, useSelectedGrant, useSelectedGrantGroupId, useSelectedGrantGroupName,
@@ -147,7 +147,7 @@ const SavePageControlsWrapper = (props) => {
   const { data: grantGroupName, mutate: mutateGrantGroupName } = useSelectedGrantGroupName();
   const { data: pageId } = useCurrentPageId();
   const { data: tagsInfoData } = useSWRxTagsInfo(pageId);
-  const { data: pageTags } = useStaticPageTags(tagsInfoData?.tags);
+  const { data: pageTags } = usePageTagsForEditors(tagsInfoData?.tags);
 
 
   if (isEditable == null || editorMode == null) {

+ 1 - 1
packages/app/src/stores/editor.tsx

@@ -91,6 +91,6 @@ export const useIsSlackEnabled = (): SWRResponse<boolean, Error> => {
   );
 };
 
-export const useStaticPageTags = (initialTags?: string[]): SWRResponse<string[], Error> => {
+export const usePageTagsForEditors = (initialTags?: string[]): SWRResponse<string[], Error> => {
   return useStaticSWR<string[], Error>('pageTags', undefined, { fallbackData: initialTags || [] });
 };