Skip to content

Commit fb244de

Browse files
committed
Implement grid column layout for categories
1 parent 4805a6d commit fb244de

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

components/Category/Categories.component.jsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,24 @@ const Categories = ({ categories }) => {
1010
return (
1111
<>
1212
<section className="container mx-auto bg-white">
13-
<div className="flex ">
13+
<div className="grid gap-2 px-2 pt-2 pb-2 lg:px-0 xl:px-0 md:px-0 lg:grid-cols-4 sm:grid-cols-2 md:grid-cols-3 xs:grid-cols-3">
1414
{categories.map(({ id, name, slug }) => (
15-
<Link as={`/kategori/${slug}?id=${id}`} href="/kategori/[id]">
15+
<Link
16+
key={uuidv4()}
17+
as={`/kategori/${slug}?id=${id}`}
18+
href="/kategori/[id]"
19+
>
1620
<div
17-
key={uuidv4()}
18-
className="flex flex-col justify-around p-6 cursor-pointer xs:w-1/2 md:w-1/3 xl:w-1/4"
21+
//className="flex flex-col justify-around p-6 cursor-pointer xs:w-1/2 md:w-1/3 xl:w-1/4"
22+
className="p-6 cursor-pointer"
1923
>
2024
<div className="flex items-center justify-center w-full h-16 text-center border border-gray-300 rounded-lg shadow hover:shadow-outline">
2125
<p className="text-lg">{name}</p>
2226
</div>
2327
</div>
2428
</Link>
2529
))}
26-
</div>
30+
</div>
2731
</section>
2832
</>
2933
);

components/Product/GetHoodiesProducts.component.jsx

Lines changed: 0 additions & 8 deletions
This file was deleted.

package-lock.json

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"nprogress": "^0.2.0",
2727
"react": "^16.13.1",
2828
"react-dom": "^16.13.1",
29+
"react-hook-form": "^6.0.1",
2930
"react-instantsearch-dom": "^6.6.0",
3031
"react-spring": "^8.0.27",
3132
"styled-components": "^5.1.1",

0 commit comments

Comments
 (0)