Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(filters): adding filter type icons in filter config modal. #31330

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ const StyledTrashIcon = styled(Icons.Trash)`
color: ${({ theme }) => theme.colors.grayscale.light3};
`;

const StyledFilterIcon = styled(Icons.Filter)`
color: ${({ theme }) => theme.colors.grayscale.light2};
margin-right: ${({ theme }) => theme.gridUnit * 2}px;
line-height: normal;
`;

const StyledDividerIcon = styled(Icons.PicCenterOutlined)`
color: ${({ theme }) => theme.colors.grayscale.light2};
margin-right: ${({ theme }) => theme.gridUnit * 2}px;
line-height: normal;
`;

const StyledWarning = styled(Icons.Warning)`
color: ${({ theme }) => theme.colors.error.base};
&.anticon {
Expand All @@ -79,6 +91,9 @@ interface Props {
erroredFilters: string[];
}

const isFilterDivider = (id: string) =>
!!id.startsWith('NATIVE_FILTER_DIVIDER');

const FilterTitleContainer = forwardRef<HTMLDivElement, Props>(
(
{
Expand Down Expand Up @@ -120,6 +135,11 @@ const FilterTitleContainer = forwardRef<HTMLDivElement, Props>(
wordBreak: 'break-all',
}}
>
{isFilterDivider(id) ? (
<StyledDividerIcon iconSize="m" />
) : (
<StyledFilterIcon iconSize="m" />
)}{' '}
{isRemoved ? t('(Removed)') : getFilterTitle(id)}
</div>
{!removedFilters[id] && isErrored && (
Expand Down
Loading