Skip to content

Commit 464e79d

Browse files
committed
Add activated indicator
1 parent b0aea1a commit 464e79d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

packages/compass-sidebar/src/components/connections-filter-popover.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
InteractivePopover,
88
Label,
99
Overline,
10+
palette,
1011
spacing,
1112
Toggle,
1213
Tooltip,
@@ -23,9 +24,17 @@ const containerStyles = css({
2324
});
2425

2526
const closeButtonStyles = css({
27+
// An alternative to this is to pass hideCloseButton to InteractivePopover,
28+
// but that throws an error when the popover is opened
2629
display: 'none',
2730
});
2831

32+
const activatedIndicatorStyles = css({
33+
position: 'absolute',
34+
top: spacing[50],
35+
right: spacing[50],
36+
});
37+
2938
const groupStyles = css({
3039
display: 'flex',
3140
flexDirection: 'row',
@@ -60,6 +69,9 @@ export default function ConnectionsFilterPopover({
6069

6170
const excludeInactiveId = useId('Sort by');
6271

72+
// Add future filters to the boolean below
73+
const isActivated = filter.excludeInactive;
74+
6375
return (
6476
<InteractivePopover
6577
open={open}
@@ -80,6 +92,18 @@ export default function ConnectionsFilterPopover({
8092
>
8193
{/* TODO: Show a small blue circle when filter.excludeInactive is enabled */}
8294
<Icon glyph="Filter" />
95+
{isActivated && (
96+
<svg
97+
className={activatedIndicatorStyles}
98+
width="6"
99+
height="6"
100+
viewBox="0 0 6 6"
101+
fill="none"
102+
xmlns="http://www.w3.org/2000/svg"
103+
>
104+
<circle cx="3" cy="3" r="3" fill={palette.blue.base} />
105+
</svg>
106+
)}
83107
</IconButton>
84108
}
85109
>

0 commit comments

Comments
 (0)