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

+ 3 - 5
packages/app/src/components/InAppNotification/InAppNotification.tsx

@@ -2,7 +2,7 @@ import React from 'react';
 
 import { UserPicture } from '@growi/ui';
 import { InAppNotification as IInAppNotification } from '../../interfaces/in-app-notification';
-import { PageUpdatedNotification, PageCommentCreatedNotification, PageCommentUpdatedNotification } from './NotificationContent';
+import { PageUpdateNotification, PageCommentNotification } from './NotificationContent';
 
 interface Props {
   notification: IInAppNotification
@@ -55,11 +55,10 @@ export const InAppNotification = (props: Props): JSX.Element => {
     switch (componentName) {
       // TODO Is the naming of componentName too subtle?
       case 'Page:UPDATE':
-        return <PageUpdatedNotification {...propsNew} onClick={props.onClick(props.notification)} />;
+        return <PageUpdateNotification {...propsNew} onClick={props.onClick(props.notification)} />;
       case 'Page:COMMENT_CREATE':
-        return <PageCommentCreatedNotification {...propsNew} onClick={props.onClick(props.notification)} />;
       case 'Page:COMMENT_UPDATE':
-        return <PageCommentUpdatedNotification {...propsNew} onClick={props.onClick(props.notification)} />;
+        return <PageCommentNotification {...propsNew} onClick={props.onClick(props.notification)} />;
       default:
         return <></>;
     }
@@ -78,5 +77,4 @@ export const InAppNotification = (props: Props): JSX.Element => {
     </>
   );
 
-
 };

+ 2 - 15
packages/app/src/components/InAppNotification/NotificationContent.tsx

@@ -9,7 +9,7 @@ interface Props {
   onClick: () => void
 }
 
-export const PageCommentCreatedNotification = (props: Props): JSX.Element => {
+export const PageCommentNotification = (props: Props): JSX.Element => {
 
   return (
     <>
@@ -22,20 +22,7 @@ export const PageCommentCreatedNotification = (props: Props): JSX.Element => {
   );
 };
 
-export const PageCommentUpdatedNotification = (props: Props): JSX.Element => {
-
-  return (
-    <>
-      <div>
-        <b>{props.actionUsers}</b> comment updated on {props.notification.target.path}
-      </div>
-      <i className="fa fa-comment-o mr-2" />
-      <FormattedDistanceDate id={props.notification._id} date={props.notification.createdAt} isShowTooltip={false} />
-    </>
-  );
-};
-
-export const PageUpdatedNotification = (props: Props): JSX.Element => {
+export const PageUpdateNotification = (props: Props): JSX.Element => {
 
   return (
     <>