Explorar o código

use PagePathLabel

Shun Miyazawa %!s(int64=4) %!d(string=hai) anos
pai
achega
46fc20f7ec

+ 7 - 5
packages/app/src/components/InAppNotification/NotificationContent.tsx

@@ -1,10 +1,8 @@
 import React from 'react';
+import { PagePathLabel } from '@growi/ui';
 import { InAppNotification as IInAppNotification } from '../../interfaces/in-app-notification';
-
 import FormattedDistanceDate from '../FormattedDistanceDate';
 
-import { PagePath } from './PagePath';
-
 interface Props {
   actionUsers: string
   notification: IInAppNotification
@@ -13,10 +11,12 @@ interface Props {
 
 export const PageCommentNotification = (props: Props): JSX.Element => {
 
+  const pagePath = { path: props.notification.target.path };
+
   return (
     <>
       <div>
-        <b>{props.actionUsers}</b> commented on <PagePath notification={props.notification} />
+        <b>{props.actionUsers}</b> commented on  <PagePathLabel page={pagePath} />
       </div>
       <i className="fa fa-comment-o mr-2" />
       <FormattedDistanceDate id={props.notification._id} date={props.notification.createdAt} isShowTooltip={false} />
@@ -26,10 +26,12 @@ export const PageCommentNotification = (props: Props): JSX.Element => {
 
 export const PageUpdateNotification = (props: Props): JSX.Element => {
 
+  const pagePath = { path: props.notification.target.path };
+
   return (
     <>
       <div>
-        <b>{props.actionUsers}</b> page updated on <PagePath notification={props.notification} />
+        <b>{props.actionUsers}</b> page updated on <PagePathLabel page={pagePath} />
       </div>
       <i className="fa fa-file-o mr-2" />
       <FormattedDistanceDate id={props.notification._id} date={props.notification.createdAt} isShowTooltip={false} />