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

+ 0 - 24
packages/app/src/components/InAppNotification/PagePath.tsx

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

+ 0 - 28
packages/core/src/utils/page-path-utils.ts

@@ -133,31 +133,3 @@ export const generateEditorPath = (...paths: string[]): string => {
     throw new Error('Invalid path format');
     throw new Error('Invalid path format');
   }
   }
 };
 };
-
-/**
- * Get page title
- * @param {string} path
- * @returns {string}
- */
-export const getPageTitle = (path: string): string => {
-  const name = path;
-
-  // /.../YYYY/MM/DD
-  if (name.match(/^.*?([^/]+\/\d{4}\/\d{2}\/\d{2}\/?)$/)) {
-    return name.replace(/^.*?([^/]+\/\d{4}\/\d{2}\/\d{2}\/?)$/, '$1');
-  }
-
-  // /.../YYYY/MM
-  if (name.match(/^.*?([^/]+\/\d{4}\/\d{2}\/?)$/)) {
-    return name.replace(/^.*?([^/]+\/\d{4}\/\d{2}\/?)$/, '$1');
-  }
-
-  // /.../YYYY
-  if (name.match(/^.*?([^/]+\/\d{4}\/?)$/)) {
-    return name.replace(/^.*?([^/]+\/\d{4}\/?)$/, '$1');
-  }
-
-  // Pick up the end of the page
-  const suffix = name.replace(/.*\/(.+\/?)$/, '$1');
-  return suffix || name;
-};