Improve battlesuit filter behavior

This commit is contained in:
Sakura Knoll
2022-07-18 12:33:05 +09:00 Unverified
parent 073ebb3448
commit efbd3e447e
4 changed files with 93 additions and 72 deletions
+4 -4
View File
@@ -8,7 +8,7 @@ interface FilterButtonProps {
active?: boolean
icon?: string
label: string
value: string
href: string
m?: string | number
close?: () => void
}
@@ -17,14 +17,14 @@ const FilterButton = ({
active = false,
icon,
label,
value,
href,
m,
close,
}: FilterButtonProps) => {
const { push } = useRouter()
return (
<Link
href={`?filter=${value}`}
href={href}
m={m}
py={1}
px={2}
@@ -36,7 +36,7 @@ const FilterButton = ({
if (close != null) {
close()
}
push({ query: { filter: value } }, undefined, { shallow: true })
push(href, href, { shallow: true })
}}
>
{icon != null && (