article filter bar mobile responsive

This commit is contained in:
mr-shortman 2025-03-15 11:59:00 +01:00
parent 0f7bf09676
commit 38b43174ec
2 changed files with 32 additions and 33 deletions

View File

@ -54,7 +54,7 @@ function ArticleFilterBar({
<>
<div
className={cn(
"flex w-full items-center justify-center gap-2 rounded-md border bg-background p-2",
"flex w-full flex-col-reverse items-center justify-center gap-2 rounded-md border bg-background p-2 lg:flex-row lg:gap-4",
className,
)}
>
@ -70,35 +70,37 @@ function ArticleFilterBar({
placeholder="Artikel Suche..."
/>
</div>
<CategorySelect
className="w-full max-w-xs"
onSelect={(category) => {
onFilterChange({
category: category?.length ? category : undefined,
});
}}
buttonProps={{
size: "sm",
}}
/>
<Combobox
hideSearch
data={sortItems}
initialValue={filter.sort}
onSelect={(currentValue) => {
onFilterChange({
sort: currentValue?.length ? currentValue : undefined,
});
}}
className="w-full max-w-64"
messageUi={{
selectIcon: FilterIcon,
select: "Sortieren",
}}
buttonProps={{
size: "sm",
}}
/>
<div className="flex w-full flex-col gap-2 sm:flex-row">
<CategorySelect
className="w-full"
onSelect={(category) => {
onFilterChange({
category: category?.length ? category : undefined,
});
}}
buttonProps={{
size: "sm",
}}
/>
<Combobox
hideSearch
data={sortItems}
initialValue={filter.sort}
onSelect={(currentValue) => {
onFilterChange({
sort: currentValue?.length ? currentValue : undefined,
});
}}
className="w-full"
messageUi={{
selectIcon: FilterIcon,
select: "Sortieren",
}}
buttonProps={{
size: "sm",
}}
/>
</div>
</div>
</>
);

View File

@ -121,9 +121,6 @@ export function Combobox({
<div className="flex items-center gap-2">
{item?.Icon && <item.Icon className="ml-auto opacity-50" />}
<span>{item.label}</span>
{/* <span className="text-xs text-muted-foreground">
{value === item.value && "ausgewählt"}
</span> */}
</div>
<Check
className={cn(