Просмотр исходного кода

show notification Date by using FormattedDistanceDate component

kaori 4 лет назад
Родитель
Сommit
ddbbbdf803

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

@@ -3,6 +3,7 @@ import React from 'react';
 import { UserPicture } from '@growi/ui';
 import { PageCommentNotification } from './PageCommentNotification';
 import { InAppNotification as IInAppNotification } from '../../interfaces/in-app-notification';
+import FormattedDistanceDate from '../FormattedDistanceDate';
 
 interface Props {
   notification: IInAppNotification
@@ -56,8 +57,11 @@ export const InAppNotification = (props: Props): JSX.Element => {
     case 'Page:COMMENT':
       return (
         <>
-          {renderUserImage()}
-          <PageCommentNotification {...propsNew} onClick={props.onClick(props.notification)} />
+          <div>
+            {renderUserImage()}
+            <PageCommentNotification {...propsNew} onClick={props.onClick(props.notification)} />
+          </div>
+          <FormattedDistanceDate id={props.notification._id} date={props.notification.createdAt} />
         </>
 
       );