Shun Miyazawa 4 лет назад
Родитель
Сommit
607d7fb511

+ 2 - 2
packages/app/src/components/InAppNotification/PagePath.tsx

@@ -4,7 +4,7 @@ import { pagePathUtils } from '@growi/core';
 
 import { InAppNotification as IInAppNotification } from '../../interfaces/in-app-notification';
 
-const { path2name } = pagePathUtils;
+const { getPageTitle } = pagePathUtils;
 
 interface Props {
   notification: IInAppNotification
@@ -13,7 +13,7 @@ interface Props {
 export const PagePath = (props: Props): JSX.Element => {
   const { notification } = props;
   const pagePath = notification.target.path;
-  const shortPath = path2name(pagePath);
+  const shortPath = getPageTitle(pagePath);
   const pathPrefix = pagePath.slice(0, -shortPath.length);
 
   return (

+ 2 - 2
packages/core/src/utils/page-path-utils.ts

@@ -135,11 +135,11 @@ export const generateEditorPath = (...paths: string[]): string => {
 };
 
 /**
- * Get the child path
+ * Get page title
  * @param {string} path
  * @returns {string}
  */
-export const path2name = (path: string): string => {
+export const getPageTitle = (path: string): string => {
   const name = path;
 
   // /.../YYYY/MM/DD