Skip to content

Commit

Permalink
refactor facet list
Browse files Browse the repository at this point in the history
  • Loading branch information
janschulte committed Jan 31, 2025
1 parent 707fc58 commit 771907b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ import { DateFacetComp } from "./DateFacet";
import { MultiSelectFacet } from "./MultiSelectFacet";
import { DateFacet, Facet, MultiSelectionFacet } from "catalog";

export function FacetComp(props: { facet: Facet }) {
export function FacetList(props: { facets: Facet[] }) {
const { facets } = props;
return facets.map((f) => <FacetComp key={f.key} facet={f}></FacetComp>);
}

function FacetComp(props: { facet: Facet }) {
const { facet } = props;

return (
Expand Down
6 changes: 2 additions & 4 deletions src/apps/empty/views/SearchView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import { ResultEntry } from "../components/ResultEntry";
import { PageSizeSelection } from "../components/PageSizeSelection";
import { InfinitePageLoad } from "../components/InfinitePageLoad";
import { Ordering } from "../components/Ordering";
import { FacetComp } from "../components/facets/Facet";
import { useOnMountUnsafe } from "../components/helper";
import { FacetList } from "../components/facets/FacetList";

export function SearchView() {
const searchSrvc = useService<SearchService>("SearchService");
Expand Down Expand Up @@ -53,9 +53,7 @@ export function SearchView() {
<Container maxW="8xl" p={5} overflow="hidden">
<Grid templateColumns="400px 1fr" gap={2} overflow="hidden" height="100%">
<GridItem w="100%" overflow="auto">
{currentFilter.facets.map((f) => (
<FacetComp key={f.key} facet={f}></FacetComp>
))}
<FacetList facets={currentFilter.facets} />
</GridItem>
<GridItem w="100%" overflow="auto">
<VStack>
Expand Down

0 comments on commit 771907b

Please sign in to comment.