Skip to content

Commit cdf5d27

Browse files
committed
Ensure Intercept option titles don't overlap close button
1 parent 68c3119 commit cdf5d27

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/components/intercept/intercept-option.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const InterceptOptionCard = styled(LittleCard)<{
111111
}
112112
113113
> h1:not(:last-child) {
114-
margin-bottom: 10px;
114+
margin-bottom: 10px; /* Override LittleCard default */
115115
}
116116
117117
> p {
@@ -129,6 +129,15 @@ const InterceptOptionCard = styled(LittleCard)<{
129129
align-items: flex-start;
130130
`;
131131

132+
const InterceptorTitle = styled.h1<{
133+
expanded: boolean
134+
}>`
135+
${p => p.expanded
136+
? 'margin-right: 20px;' // Avoid overlapping the close icon
137+
: ''
138+
}
139+
`;
140+
132141
const LoadingOverlay = styled.div`
133142
position: absolute;
134143
top: 0;
@@ -233,7 +242,9 @@ export class InterceptOption extends React.Component<InterceptOptionProps> {
233242
}
234243
</BackgroundIcons>
235244

236-
<h1>{ interceptor.name }</h1>
245+
<InterceptorTitle expanded={expanded}>
246+
{ interceptor.name }
247+
</InterceptorTitle>
237248

238249
{ ConfigComponent && expanded
239250
? <>

0 commit comments

Comments
 (0)