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

+ 3 - 3
packages/app/src/components/FormattedDistanceDate.jsx

@@ -14,7 +14,7 @@ const FormattedDistanceDate = (props) => {
   const dateFormatted = format(date, 'yyyy/MM/dd HH:mm');
 
   const diff = Math.abs(differenceInSeconds(date, baseDate));
-  if (props.isEnabledShowDate && diff > props.differenceForAvoidingFormat) {
+  if (!props.isNotShowDate && diff > props.differenceForAvoidingFormat) {
     return <>{dateFormatted}</>;
   }
 
@@ -35,12 +35,12 @@ FormattedDistanceDate.propTypes = {
   // the number(sec) from 'baseDate' to avoid format
   differenceForAvoidingFormat: PropTypes.number,
   isShowTooltip: PropTypes.bool,
-  isEnabledShowDate: PropTypes.bool,
+  isNotShowDate: PropTypes.bool,
 };
 FormattedDistanceDate.defaultProps = {
   differenceForAvoidingFormat: 86400 * 3,
   isShowTooltip: true,
-  isEnabledShowDate: true,
+  isNotShowDate: false,
 };
 
 export default FormattedDistanceDate;

+ 1 - 6
packages/app/src/components/InAppNotification/InAppNotificationElm.tsx

@@ -101,12 +101,7 @@ const InAppNotificationElm = (props: Props): JSX.Element => {
             <b>{actionUsers}</b> {actionMsg} <PagePathLabel page={pagePath} />
           </div>
           <i className={`${actionIcon} mr-2`} />
-          <FormattedDistanceDate
-            id={notification._id}
-            date={notification.createdAt}
-            isShowTooltip={false}
-            isEnabledShowDate={false}
-          />
+          <FormattedDistanceDate id={notification._id} date={notification.createdAt} isShowTooltip={false} isNotShowDate />
         </div>
       </div>
     </div>