Skip to content

Commit

Permalink
Align SearchFilterChips (#679)
Browse files Browse the repository at this point in the history
- Replace ChipSpacer with gap
  • Loading branch information
lindskogen authored Nov 23, 2023
1 parent 3376c0d commit c25bcf9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 29 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from "react";
import { ChipSpacer } from "./ChipSpacer";
import { Chip } from "@stenajs-webui/elements";
import { useCallback } from "react";
import { useSearchFilterDispatch } from "../../context/SearchFilterDispatchContext";
Expand All @@ -23,9 +22,5 @@ export const EmptyChip = function EmptyChip<TSectionKey extends string>({
dispatch(actions.openFilters());
}, [actions, dispatch, sectionId]);

return (
<ChipSpacer>
<Chip label={label} variant={"secondary"} onClick={onClickLabel} />
</ChipSpacer>
);
return <Chip label={label} variant={"secondary"} onClick={onClickLabel} />;
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from "react";
import { useCallback } from "react";
import { ChipSpacer } from "./ChipSpacer";
import { Chip } from "@stenajs-webui/elements";
import { useSearchFilterDispatch } from "../../context/SearchFilterDispatchContext";
import { useSearchFilterActions } from "../../context/SearchFilterActionsContext";
Expand Down Expand Up @@ -42,12 +41,10 @@ export const SearchFilterChip = function SearchFilterChip<
}, [actions, dispatch, sectionId]);

return (
<ChipSpacer>
<Chip
label={label ?? sectionId}
onClick={onClickLabel}
onClickRemove={onClickRemove ? onClickRemoveHandler : undefined}
/>
</ChipSpacer>
<Chip
label={label ?? sectionId}
onClick={onClickLabel}
onClickRemove={onClickRemove ? onClickRemoveHandler : undefined}
/>
);
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from "react";
import { ReactNode, useCallback } from "react";
import { Row } from "@stenajs-webui/core";
import { ChipSpacer } from "./ChipSpacer";
import { FlatButton } from "@stenajs-webui/elements";
import { useSearchFilterDispatch } from "../../context/SearchFilterDispatchContext";
import { useSearchFilterActions } from "../../context/SearchFilterActionsContext";
Expand All @@ -24,16 +23,14 @@ export const SearchFilterChips: React.FC<SearchFilterChipsProps> = ({
);

return (
<Row flexWrap={"wrap"}>
<Row flexWrap={"wrap"} alignItems={"center"} gap>
{children}
{!disableClearAllButton && (
<ChipSpacer>
<FlatButton
size={"small"}
label={"Clear all"}
onClick={onClickClearAll}
/>
</ChipSpacer>
<FlatButton
size={"small"}
label={"Clear all"}
onClick={onClickClearAll}
/>
)}
</Row>
);
Expand Down

0 comments on commit c25bcf9

Please sign in to comment.