kosei-n 2 лет назад
Родитель
Сommit
42881b68eb

+ 1 - 6
apps/app/src/components/PageHeader/PageHeader.tsx

@@ -1,16 +1,11 @@
 import { useState } from 'react';
 import { useState } from 'react';
-import type { Dispatch, SetStateAction, FC } from 'react';
+import type { FC } from 'react';
 
 
 import { useSWRxCurrentPage } from '~/stores/page';
 import { useSWRxCurrentPage } from '~/stores/page';
 
 
 import { PagePathHeader } from './PagePathHeader';
 import { PagePathHeader } from './PagePathHeader';
 import { PageTitleHeader } from './PageTitleHeader';
 import { PageTitleHeader } from './PageTitleHeader';
 
 
-export type editedPagePathState = {
-  editedPagePath: string
-  setEditedPagePath: Dispatch<SetStateAction<string>>
-}
-
 export const PageHeader: FC = () => {
 export const PageHeader: FC = () => {
   const { data: currentPage } = useSWRxCurrentPage();
   const { data: currentPage } = useSWRxCurrentPage();
   const currentPagePath = currentPage?.path;
   const currentPagePath = currentPage?.path;

+ 3 - 2
apps/app/src/components/PageHeader/PagePathHeader.tsx

@@ -1,5 +1,5 @@
-import type { FC } from 'react';
 import { useMemo, useState, useEffect } from 'react';
 import { useMemo, useState, useEffect } from 'react';
+import type { FC } from 'react';
 
 
 import type { IPagePopulatedToShowRevision } from '@growi/core';
 import type { IPagePopulatedToShowRevision } from '@growi/core';
 
 
@@ -9,10 +9,11 @@ import { EditorMode, useEditorMode } from '~/stores/ui';
 import { PagePathNav } from '../Common/PagePathNav';
 import { PagePathNav } from '../Common/PagePathNav';
 import { PageSelectModal } from '../PageSelectModal/PageSelectModal';
 import { PageSelectModal } from '../PageSelectModal/PageSelectModal';
 
 
-import type { editedPagePathState } from './PageHeader';
+import type { editedPagePathState } from './TextInputForPageTitleAndPath';
 import { TextInputForPageTitleAndPath } from './TextInputForPageTitleAndPath';
 import { TextInputForPageTitleAndPath } from './TextInputForPageTitleAndPath';
 import { usePagePathRenameHandler } from './page-header-utils';
 import { usePagePathRenameHandler } from './page-header-utils';
 
 
+
 export type Props = {
 export type Props = {
   currentPage: IPagePopulatedToShowRevision
   currentPage: IPagePopulatedToShowRevision
   editedPagePathState: editedPagePathState
   editedPagePathState: editedPagePathState

+ 1 - 1
apps/app/src/components/PageHeader/PageTitleHeader.tsx

@@ -17,7 +17,7 @@ export const PageTitleHeader: FC<Props> = (props) => {
 
 
   const currentPagePath = currentPage.path;
   const currentPagePath = currentPage.path;
 
 
-  const pageTitle = nodePath.basename(currentPagePath ?? '') || '/';
+  const pageTitle = nodePath.basename(currentPagePath) || '/';
 
 
   const [isRenameInputShown, setRenameInputShown] = useState(false);
   const [isRenameInputShown, setRenameInputShown] = useState(false);
 
 

+ 4 - 2
apps/app/src/components/PageHeader/TextInputForPageTitleAndPath.tsx

@@ -11,10 +11,12 @@ import { ValidationTarget } from '~/client/util/input-validator';
 
 
 import ClosableTextInput from '../Common/ClosableTextInput';
 import ClosableTextInput from '../Common/ClosableTextInput';
 
 
-
-import type { editedPagePathState } from './PageHeader';
 import { usePagePathRenameHandler } from './page-header-utils';
 import { usePagePathRenameHandler } from './page-header-utils';
 
 
+export type editedPagePathState = {
+  editedPagePath: string
+  setEditedPagePath: Dispatch<SetStateAction<string>>
+}
 
 
 type StateHandler = {
 type StateHandler = {
   isRenameInputShown: boolean
   isRenameInputShown: boolean