Skip to content

Commit abcea87

Browse files
committed
Fixed PLayright test, and category filter for product page
1 parent 9dcf5d6 commit abcea87

File tree

5 files changed

+13
-25
lines changed

5 files changed

+13
-25
lines changed

gui_afsluttende/src/App.css

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +0,0 @@
1-
#root {
2-
width: 100%;
3-
}
4-
5-
.class_wrapper {
6-
min-height: 100vh;
7-
display: flex;
8-
flex-direction: column;
9-
}
10-

gui_afsluttende/src/components/CategoryBar/CategoryBar.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default function CategoryBar() {
4949
<div className="category-bar">
5050
<div className="container category-inner">
5151
<button
52-
className={"cat-btn" + (active === "all" ? " active" : "")}
52+
className={"cat-btn"}
5353
onClick={() => goCategory("all")}
5454
>
5555
Alle kategorier
@@ -58,9 +58,7 @@ export default function CategoryBar() {
5858
{categories.map((c) => (
5959
<button
6060
key={c.id}
61-
className={
62-
"cat-btn" + (String(active) === String(c.id) ? " active" : "")
63-
}
61+
className={"cat-btn" }
6462
onClick={() => goCategory(c.id)}
6563
>
6664
{c.title}

gui_afsluttende/src/components/GridContainer/GridContainer.jsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ export default function GridContainer({ products, children }) {
55
if (products && products.length) {
66
return (
77
<div className="product-grid">
8-
{products.map((item) => (
9-
<article key={item.id} className="product-card">
10-
{item.image_url && (
8+
{products.map((product) => (
9+
<article key={product.id} className="product-card">
10+
{product.image_url && (
1111
<img
1212
className="product-image"
13-
src={item.image_url}
14-
alt={item.title}
13+
src={product.image_url}
14+
alt={product.title}
1515
/>
1616
)}
17-
<h3 className="product-title">{item.title}</h3>
18-
<p className="product-price">Price: {item.price}</p>
19-
<p className="product-desc">{item.description}</p>
20-
<Link className="product-link" to={`/products/${item.id}`}>
17+
<h3 className="product-title">{product.title}</h3>
18+
<p className="product-price">Price: {product.price}</p>
19+
<p className="product-desc">{product.description}</p>
20+
<Link className="product-link" to={`/products/${product.id}`}>
2121
View Descriptions
2222
</Link>
2323
</article>

gui_afsluttende/src/index.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ body {
3535
color: var(--text);
3636
}
3737

38-
/* Center content like in Figma */
38+
3939
.container {
4040
max-width: var(--container);
4141
margin: 0 auto;
@@ -57,4 +57,4 @@ button {
5757
cursor: pointer;
5858
}
5959

60-
/* Light mode adjustments can be added later if needed */
60+
38.4 KB
Loading

0 commit comments

Comments
 (0)