Skip to content

Commit

Permalink
fix: update getFilterHeaderText logic
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwardBrunton committed Jan 29, 2025
1 parent e6a7b45 commit 700b515
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/filter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/workspace-filter",
"version": "4.0.10",
"version": "4.0.11",
"type": "module",
"sideEffects": false,
"license": "MIT",
Expand Down
7 changes: 2 additions & 5 deletions packages/filter/src/lib/utils/getFilterHeaderText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import { StyledNormalText } from '../components/filterGroup/filterGroup.styles';

export function getFilterHeaderText(isAllChecked: boolean, name: string, checkedValues: string[]): JSX.Element {
const selectedCount = checkedValues.length;
const displayText = selectedCount > 0 ? `${name} (+${selectedCount})` : name;

const textComponent = <StyledNormalText>{displayText}</StyledNormalText>;

return isAllChecked || selectedCount === 0 ? (
textComponent
<StyledNormalText>{name}</StyledNormalText>
) : (
<div style={{ color: tokens.colors.interactive.primary__resting.hex }}>{displayText}</div>
<div style={{ color: tokens.colors.interactive.primary__resting.hex }}>{`${name} (+${selectedCount})`}</div>
);
}
2 changes: 1 addition & 1 deletion packages/workspace-fusion/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/workspace-fusion",
"version": "9.0.24",
"version": "9.0.25",
"type": "module",
"sideEffects": false,
"license": "MIT",
Expand Down

0 comments on commit 700b515

Please sign in to comment.