Browse Source

fix: adjusted time so that absolute is shown on hover and not relative (#34931)

Closes #34842 
Swapped Relative and absolute times on the console view.
<img width="1691" alt="image" src="https://user-images.githubusercontent.com/7014871/169891840-d27456eb-a038-4cb1-8140-581e81cebfce.png">
Dublin Anondson 2 years ago
parent
commit
f79466ab62
1 changed files with 7 additions and 13 deletions
  1. 7 13
      static/app/views/replays/detail/console/consoleMessage.tsx

+ 7 - 13
static/app/views/replays/detail/console/consoleMessage.tsx

@@ -5,11 +5,10 @@ import {sprintf, vsprintf} from 'sprintf-js';
 import DateTime from 'sentry/components/dateTime';
 import AnnotatedText from 'sentry/components/events/meta/annotatedText';
 import {getMeta} from 'sentry/components/events/meta/metaProxy';
-import {Hovercard} from 'sentry/components/hovercard';
 import {useReplayContext} from 'sentry/components/replays/replayContext';
 import {relativeTimeInMs, showPlayerTime} from 'sentry/components/replays/utils';
+import Tooltip from 'sentry/components/tooltip';
 import {IconClose, IconWarning} from 'sentry/icons';
-import {t} from 'sentry/locale';
 import space from 'sentry/styles/space';
 import {BreadcrumbTypeDefault} from 'sentry/types/breadcrumbs';
 
@@ -92,20 +91,15 @@ function ConsoleMessage({breadcrumb, isLast, startTimestamp = 0}: ConsoleMessage
         <MessageFormatter breadcrumb={breadcrumb} />
       </Message>
       <ConsoleTimestamp isLast={isLast} level={breadcrumb.level}>
-        <Hovercard
-          body={`${t('Relative Time')}: ${showPlayerTime(
-            breadcrumb.timestamp || '',
-            startTimestamp
-          )}`}
-        >
-          <DateTime
-            timeOnly
-            date={breadcrumb.timestamp}
+        <Tooltip title={<DateTime date={breadcrumb.timestamp} seconds />}>
+          <div
             onClick={handleOnClick}
             onMouseOver={handleOnMouseOver}
             onMouseOut={handleOnMouseOut}
-          />
-        </Hovercard>
+          >
+            {showPlayerTime(breadcrumb.timestamp || '', startTimestamp)}
+          </div>
+        </Tooltip>
       </ConsoleTimestamp>
     </Fragment>
   );