-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(filters): Add icon for group property filters (#24762)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0c62586
commit dccb835
Showing
3 changed files
with
13 additions
and
10 deletions.
There are no files selected for viewing
Binary file modified
BIN
-12.3 KB
(62%)
frontend/__snapshots__/filters-property-filter-button--filter-types--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-11.7 KB
(63%)
frontend/__snapshots__/filters-property-filter-button--filter-types--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 13 additions & 10 deletions
23
frontend/src/lib/components/PropertyFilters/components/PropertyFilterIcon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,36 @@ | ||
import { IconPerson } from '@posthog/icons' | ||
import { IconBuilding, IconPerson } from '@posthog/icons' | ||
import { IconCohort, IconUnverifiedEvent } from 'lib/lemon-ui/icons' | ||
import { Tooltip } from 'lib/lemon-ui/Tooltip' | ||
|
||
import { PropertyFilterType } from '~/types' | ||
|
||
export function PropertyFilterIcon({ type }: { type?: PropertyFilterType }): JSX.Element { | ||
let iconElement = <></> | ||
export function PropertyFilterIcon({ type }: { type?: PropertyFilterType }): JSX.Element | null { | ||
switch (type) { | ||
case 'event': | ||
iconElement = ( | ||
return ( | ||
<Tooltip title="Event property"> | ||
<IconUnverifiedEvent /> | ||
</Tooltip> | ||
) | ||
break | ||
case 'person': | ||
iconElement = ( | ||
return ( | ||
<Tooltip title="Person property"> | ||
<IconPerson /> | ||
</Tooltip> | ||
) | ||
break | ||
case 'cohort': | ||
iconElement = ( | ||
return ( | ||
<Tooltip title="Cohort filter"> | ||
<IconCohort /> | ||
</Tooltip> | ||
) | ||
break | ||
case 'group': | ||
return ( | ||
<Tooltip title="Group filter"> | ||
<IconBuilding /> | ||
</Tooltip> | ||
) | ||
default: | ||
return null | ||
} | ||
return iconElement | ||
} |