Browse Source

not to show tooltip for in-app-notification

kaori 4 years ago
parent
commit
c3537c520c

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

@@ -23,7 +23,7 @@ const FormattedDistanceDate = (props) => {
   return (
   return (
     <>
     <>
       <span id={elemId}>{formatDistanceStrict(date, baseDate)}</span>
       <span id={elemId}>{formatDistanceStrict(date, baseDate)}</span>
-      <UncontrolledTooltip placement="bottom" fade={false} target={elemId}>{dateFormatted}</UncontrolledTooltip>
+      {props.isShowTooltip && <UncontrolledTooltip placement="bottom" fade={false} target={elemId}>{dateFormatted}</UncontrolledTooltip>}
     </>
     </>
   );
   );
 };
 };
@@ -34,9 +34,11 @@ FormattedDistanceDate.propTypes = {
   baseDate: PropTypes.instanceOf(Date),
   baseDate: PropTypes.instanceOf(Date),
   // the number(sec) from 'baseDate' to avoid format
   // the number(sec) from 'baseDate' to avoid format
   differenceForAvoidingFormat: PropTypes.number,
   differenceForAvoidingFormat: PropTypes.number,
+  isShowTooltip: PropTypes.bool,
 };
 };
 FormattedDistanceDate.defaultProps = {
 FormattedDistanceDate.defaultProps = {
   differenceForAvoidingFormat: 86400 * 3,
   differenceForAvoidingFormat: 86400 * 3,
+  isShowTooltip: true,
 };
 };
 
 
 export default FormattedDistanceDate;
 export default FormattedDistanceDate;

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

@@ -61,7 +61,7 @@ export const InAppNotification = (props: Props): JSX.Element => {
             {renderUserImage()}
             {renderUserImage()}
             <PageCommentNotification {...propsNew} onClick={props.onClick(props.notification)} />
             <PageCommentNotification {...propsNew} onClick={props.onClick(props.notification)} />
           </div>
           </div>
-          <FormattedDistanceDate id={props.notification._id} date={props.notification.createdAt} />
+          <FormattedDistanceDate id={props.notification._id} date={props.notification.createdAt} isShowTooltip={false} />
         </>
         </>
 
 
       );
       );