Skip to content

Commit

Permalink
fix(hydration issue): Fix tooltip position for test copy button (#82912)
Browse files Browse the repository at this point in the history
**Before**
both tooltips were active at the same time:

![SCR-20250103-nqhc](https://github.com/user-attachments/assets/4395eadf-e0fa-455f-a66f-3e9c7335840a)

**After**
one at a time
<img width="137" alt="SCR-20250103-nqiu"
src="https://github.com/user-attachments/assets/b147f3f3-eaa7-42d7-a990-6c959ea3066f"
/>
  • Loading branch information
ryan953 authored Jan 3, 2025
1 parent 7604cde commit 205decf
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions static/app/components/replays/diff/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,47 +31,47 @@ interface BeforeAfterProps {

export function Before({children, offset, startTimestampMs}: BeforeAfterProps) {
return (
<Tooltip
title={
<LeftAligned>
{t('The server-rendered page')}
<div>
<ReplayTooltipTime
timestampMs={startTimestampMs + offset}
startTimestampMs={startTimestampMs}
/>
</div>
</LeftAligned>
}
>
<Label>
<Label>
<Tooltip
title={
<LeftAligned>
{t('The server-rendered page')}
<div>
<ReplayTooltipTime
timestampMs={startTimestampMs + offset}
startTimestampMs={startTimestampMs}
/>
</div>
</LeftAligned>
}
>
{t('Before')}
{children}
</Label>
</Tooltip>
</Tooltip>
{children}
</Label>
);
}

export function After({children, offset, startTimestampMs}: BeforeAfterProps) {
return (
<Tooltip
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>
<Tooltip
title={
<LeftAligned>
{t('After React re-rendered the page, and reported a hydration error')}
<div>
<ReplayTooltipTime
timestampMs={startTimestampMs + offset}
startTimestampMs={startTimestampMs}
/>
</div>
</LeftAligned>
}
>
{t('After')}
{children}
</Label>
</Tooltip>
</Tooltip>
{children}
</Label>
);
}

Expand Down

0 comments on commit 205decf

Please sign in to comment.