|
@@ -1,5 +1,6 @@
|
|
import styled from '@emotion/styled';
|
|
import styled from '@emotion/styled';
|
|
|
|
|
|
|
|
+import ReplayTooltipTime from 'sentry/components/replays/replayTooltipTime';
|
|
import {Tooltip} from 'sentry/components/tooltip';
|
|
import {Tooltip} from 'sentry/components/tooltip';
|
|
import {t} from 'sentry/locale';
|
|
import {t} from 'sentry/locale';
|
|
import {space} from 'sentry/styles/space';
|
|
import {space} from 'sentry/styles/space';
|
|
@@ -22,15 +23,27 @@ export const DiffHeader = styled('div')`
|
|
}
|
|
}
|
|
`;
|
|
`;
|
|
|
|
|
|
-const Label = styled('div')`
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- font-weight: bold;
|
|
|
|
-`;
|
|
|
|
|
|
+interface BeforeAfterProps {
|
|
|
|
+ offset: number;
|
|
|
|
+ startTimestampMs: number;
|
|
|
|
+ children?: React.ReactNode;
|
|
|
|
+}
|
|
|
|
|
|
-export function Before({children}: {children?: React.ReactNode}) {
|
|
|
|
|
|
+export function Before({children, offset, startTimestampMs}: BeforeAfterProps) {
|
|
return (
|
|
return (
|
|
- <Tooltip title={t('How the initial server-rendered page looked.')}>
|
|
|
|
|
|
+ <Tooltip
|
|
|
|
+ title={
|
|
|
|
+ <LeftAligned>
|
|
|
|
+ {t('The server-rendered page')}
|
|
|
|
+ <div>
|
|
|
|
+ <ReplayTooltipTime
|
|
|
|
+ timestampMs={startTimestampMs + offset}
|
|
|
|
+ startTimestampMs={startTimestampMs}
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </LeftAligned>
|
|
|
|
+ }
|
|
|
|
+ >
|
|
<Label>
|
|
<Label>
|
|
{t('Before')}
|
|
{t('Before')}
|
|
{children}
|
|
{children}
|
|
@@ -38,12 +51,21 @@ export function Before({children}: {children?: React.ReactNode}) {
|
|
</Tooltip>
|
|
</Tooltip>
|
|
);
|
|
);
|
|
}
|
|
}
|
|
-export function After({children}: {children?: React.ReactNode}) {
|
|
|
|
|
|
+
|
|
|
|
+export function After({children, offset, startTimestampMs}: BeforeAfterProps) {
|
|
return (
|
|
return (
|
|
<Tooltip
|
|
<Tooltip
|
|
- title={t(
|
|
|
|
- 'How React re-rendered the page on your browser, after detecting a hydration error.'
|
|
|
|
- )}
|
|
|
|
|
|
+ title={
|
|
|
|
+ <LeftAligned>
|
|
|
|
+ {t('After React re-rendered the page, and reported a hydration error')}
|
|
|
|
+ <div>
|
|
|
|
+ <ReplayTooltipTime
|
|
|
|
+ timestampMs={startTimestampMs + offset}
|
|
|
|
+ startTimestampMs={startTimestampMs}
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </LeftAligned>
|
|
|
|
+ }
|
|
>
|
|
>
|
|
<Label>
|
|
<Label>
|
|
{t('After')}
|
|
{t('After')}
|
|
@@ -52,3 +74,16 @@ export function After({children}: {children?: React.ReactNode}) {
|
|
</Tooltip>
|
|
</Tooltip>
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+const LeftAligned = styled('div')`
|
|
|
|
+ text-align: left;
|
|
|
|
+ display: flex;
|
|
|
|
+ gap: ${space(1)};
|
|
|
|
+ flex-direction: column;
|
|
|
|
+`;
|
|
|
|
+
|
|
|
|
+const Label = styled('div')`
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+`;
|