Added sort option to the UI

This commit is contained in:
Luis Alvarez
2020-10-14 11:50:38 -05:00
parent 398feac176
commit cdb2cbdebd
2 changed files with 7 additions and 3 deletions

View File

@@ -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>()