Răsfoiți Sursa

create PageCommentUpdatedNotification

Shun Miyazawa 4 ani în urmă
părinte
comite
2e788609d7

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

@@ -1,8 +1,9 @@
 import React from 'react';
 import React from 'react';
 
 
 import { UserPicture } from '@growi/ui';
 import { UserPicture } from '@growi/ui';
-import { PageUpdatedNotification, PageCommentCreatedNotification } from './PageContent';
 import { InAppNotification as IInAppNotification } from '../../interfaces/in-app-notification';
 import { InAppNotification as IInAppNotification } from '../../interfaces/in-app-notification';
+import { PageUpdatedNotification, PageCommentCreatedNotification, PageCommentUpdatedNotification } from './PageContent';
+
 
 
 interface Props {
 interface Props {
   notification: IInAppNotification
   notification: IInAppNotification
@@ -59,7 +60,7 @@ export const InAppNotification = (props: Props): JSX.Element => {
       case 'Page:COMMENT_CREATE':
       case 'Page:COMMENT_CREATE':
         return <PageCommentCreatedNotification {...propsNew} onClick={props.onClick(props.notification)} />;
         return <PageCommentCreatedNotification {...propsNew} onClick={props.onClick(props.notification)} />;
       case 'Page:COMMENT_UPDATE':
       case 'Page:COMMENT_UPDATE':
-        return <PageCommentNotification {...propsNew} onClick={props.onClick(props.notification)} />;
+        return <PageCommentUpdatedNotification {...propsNew} onClick={props.onClick(props.notification)} />;
       default:
       default:
         return <></>;
         return <></>;
     }
     }

+ 12 - 0
packages/app/src/components/InAppNotification/PageContent.tsx

@@ -22,6 +22,18 @@ export const PageCommentCreatedNotification = (props: Props) => {
   );
   );
 };
 };
 
 
+export const PageCommentUpdatedNotification = (props: Props) => {
+
+  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) => {
 export const PageUpdatedNotification = (props: Props) => {