Skip to content

Commit 761c507

Browse files
authored
fix(replays): Fix alignment of OS & Browser icons in Replay Details header (#46151)
Corrected the icon alignment, and along the way improved the tooltip content. Also, the tooltip change helped make the alignment fix easier. **Before:** Alignment was messed up on the Details page ![Image](https://user-images.githubusercontent.com/187460/226713132-3c0c31e6-d8e2-4f44-a0db-2f26a2f59fb3.png) **After:** Details alignment is fixed, list page still looks good. ![SCR-20230321-jg2](https://user-images.githubusercontent.com/187460/226739951-332a0f1b-0a83-45d4-94f2-374000f6731f.png) ![SCR-20230321-jfx](https://user-images.githubusercontent.com/187460/226739954-c6f24837-6692-44ab-830f-ff9a46e524bc.png) Fixes #46139
1 parent d44a0cd commit 761c507

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

static/app/components/replays/contextIcon.tsx

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,38 @@ const LazyContextIcon = lazy(
1717
);
1818

1919
const ContextIcon = styled(({className, name, version}: Props) => {
20-
const icon = generateIconName(name, version ?? undefined);
20+
const icon = generateIconName(name, version);
21+
22+
const title = (
23+
<CountTooltipContent>
24+
<dt>Name:</dt>
25+
<dd>{name}</dd>
26+
{version ? <dt>Version:</dt> : null}
27+
{version ? <dd>{version}</dd> : null}
28+
</CountTooltipContent>
29+
);
2130
return (
22-
<div className={className}>
23-
<Tooltip title={name}>
24-
<Suspense fallback={<LoadingMask />}>
25-
<LazyContextIcon name={icon} size="sm" />
26-
</Suspense>
27-
</Tooltip>
28-
{version ? <div>{version}</div> : null}
29-
</div>
31+
<Tooltip title={title} className={className}>
32+
<Suspense fallback={<LoadingMask />}>
33+
<LazyContextIcon name={icon} size="sm" />
34+
</Suspense>
35+
{version ? version : null}
36+
</Tooltip>
3037
);
3138
})`
3239
display: flex;
3340
gap: ${space(1)};
3441
font-variant-numeric: tabular-nums;
42+
align-items: center;
43+
`;
44+
45+
const CountTooltipContent = styled('dl')`
46+
display: grid;
47+
grid-template-columns: 1fr max-content;
48+
gap: ${space(1)} ${space(3)};
49+
text-align: left;
50+
align-items: center;
51+
margin-bottom: 0;
3552
`;
3653

3754
export default ContextIcon;

0 commit comments

Comments
 (0)