mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Added sort option to the UI
This commit is contained in:
@@ -17,7 +17,7 @@ export async function getStaticProps({ preview }: GetStaticPropsContext) {
|
||||
}
|
||||
}
|
||||
|
||||
export default function Home({
|
||||
export default function Search({
|
||||
categories,
|
||||
brands,
|
||||
}: InferGetStaticPropsType<typeof getStaticProps>) {
|
||||
@@ -39,6 +39,7 @@ export default function Home({
|
||||
search: typeof q === 'string' ? q : '',
|
||||
categoryId: activeCategory?.entityId,
|
||||
brandId: activeBrand?.entityId,
|
||||
sort: typeof sort === 'string' ? sort : '',
|
||||
})
|
||||
|
||||
return (
|
||||
@@ -178,7 +179,7 @@ export default function Home({
|
||||
)
|
||||
}
|
||||
|
||||
Home.Layout = Layout
|
||||
Search.Layout = Layout
|
||||
|
||||
function useSearchMeta(asPath: string) {
|
||||
const [category, setCategory] = useState<string | undefined>()
|
||||
|
Reference in New Issue
Block a user