-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(replay): Update hydration Before/After labels to have timestamps …
…in their tooltip (#82895)
- Loading branch information
Showing
7 changed files
with
106 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import {Fragment} from 'react'; | ||
import styled from '@emotion/styled'; | ||
|
||
import {t} from 'sentry/locale'; | ||
import {getFormat, getFormattedDate} from 'sentry/utils/dates'; | ||
import formatDuration from 'sentry/utils/duration/formatDuration'; | ||
|
||
interface Props { | ||
startTimestampMs: number; | ||
timestampMs: number; | ||
} | ||
|
||
export default function ReplayTooltipTime({startTimestampMs, timestampMs}: Props) { | ||
return ( | ||
<Fragment> | ||
<TooltipTime> | ||
{t( | ||
'Date: %s', | ||
getFormattedDate( | ||
timestampMs, | ||
`${getFormat({year: true, seconds: true, timeZone: true})}`, | ||
{ | ||
local: true, | ||
} | ||
) | ||
)} | ||
</TooltipTime> | ||
<TooltipTime> | ||
{t( | ||
'Time within replay: %s', | ||
formatDuration({ | ||
duration: [Math.abs(timestampMs - startTimestampMs), 'ms'], | ||
precision: 'ms', | ||
style: 'hh:mm:ss.sss', | ||
}) | ||
)} | ||
</TooltipTime> | ||
</Fragment> | ||
); | ||
} | ||
|
||
const TooltipTime = styled('div')` | ||
text-align: left; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters