Skip to content

Commit

Permalink
Uses the transient for the styled component to avoid React stack traces
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankHassanabad committed Aug 12, 2021
1 parent 1b88880 commit cfa5f6f
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const FILTER_OPEN: Status = 'open';
export const FILTER_CLOSED: Status = 'closed';
export const FILTER_IN_PROGRESS: Status = 'in-progress';

const StatusFilterButton = styled(EuiFilterButton)<{ isActive: boolean }>`
background: ${({ isActive, theme }) => (isActive ? theme.eui.euiColorPrimary : '')};
const StatusFilterButton = styled(EuiFilterButton)<{ $isActive: boolean }>`
background: ${({ $isActive, theme }) => ($isActive ? theme.eui.euiColorPrimary : '')};
`;

const StatusFilterGroup = styled(EuiFilterGroup)`
Expand Down Expand Up @@ -54,7 +54,7 @@ const AlertsTableFilterGroupComponent: React.FC<Props> = ({ onFilterGroupChanged
<StatusFilterButton
data-test-subj="openAlerts"
hasActiveFilters={filterGroup === FILTER_OPEN}
isActive={filterGroup === FILTER_OPEN}
$isActive={filterGroup === FILTER_OPEN}
onClick={onClickOpenFilterCallback}
withNext
color={filterGroup === FILTER_OPEN ? 'ghost' : 'primary'}
Expand All @@ -65,7 +65,7 @@ const AlertsTableFilterGroupComponent: React.FC<Props> = ({ onFilterGroupChanged
<StatusFilterButton
data-test-subj="inProgressAlerts"
hasActiveFilters={filterGroup === FILTER_IN_PROGRESS}
isActive={filterGroup === FILTER_IN_PROGRESS}
$isActive={filterGroup === FILTER_IN_PROGRESS}
onClick={onClickInProgressFilterCallback}
withNext
color={filterGroup === FILTER_IN_PROGRESS ? 'ghost' : 'primary'}
Expand All @@ -76,7 +76,7 @@ const AlertsTableFilterGroupComponent: React.FC<Props> = ({ onFilterGroupChanged
<StatusFilterButton
data-test-subj="closedAlerts"
hasActiveFilters={filterGroup === FILTER_CLOSED}
isActive={filterGroup === FILTER_CLOSED}
$isActive={filterGroup === FILTER_CLOSED}
onClick={onClickCloseFilterCallback}
color={filterGroup === FILTER_CLOSED ? 'ghost' : 'primary'}
>
Expand Down

0 comments on commit cfa5f6f

Please sign in to comment.