Skip to content

Commit 05cac97

Browse files
committed
Add checkout button to cart page
1 parent 1d030f2 commit 05cac97

File tree

8 files changed

+29
-33
lines changed

8 files changed

+29
-33
lines changed

components/Cart/Cart.component.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const Cart = () => {
1818

1919
return (
2020
<>
21-
<Link href="/cart">
21+
<Link href="/handlekurv">
2222
<a className="inline-block pl-3 no-underline hover:text-black">
2323
<svg
2424
className="fill-current hover:text-black"

components/Cart/CartPage/CartItem.component.jsx

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,12 @@ const CartItem = ({
4141
? item.totalPrice.toFixed(2)
4242
: item.totalPrice}
4343
</td>
44+
45+
46+
47+
4448
</tr>
4549
);
4650
};
4751

4852
export default CartItem;
49-
50-
/*
51-
<tr className="bg-gray-100">
52-
<td className="px-4 py-2 border">Test</td>
53-
<td className="px-4 py-2 border">Test</td>
54-
<td className="px-4 py-2 border">Test</td>
55-
<td className="px-4 py-2 border">Test</td>
56-
</tr>
57-
<tr className="bg-gray-100">
58-
<td className="px-4 py-2 border">Test</td>
59-
<td className="px-4 py-2 border">Test</td>
60-
<td className="px-4 py-2 border">Test</td>
61-
<td className="px-4 py-2 border">Test</td>
62-
</tr>
63-
<tr className="bg-gray-100">
64-
<td className="px-4 py-2 border">Testx</td>
65-
<td className="px-4 py-2 border">Testxx</td>
66-
<td className="px-4 py-2 border">Testxxxx</td>
67-
<td className="px-4 py-2 border">Test xxxxxxxxxx</td>
68-
*/

components/Cart/CartPage/CartItemsContainer.component.jsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
import CartItem from 'components/Cart/CartPage/CartItem.component';
1515
import PageTitle from 'components/Header/PageTitle.component';
1616

17-
import { WOO_CONFIG } from 'utils/config/nextConfig';
1817
import { GET_CART } from 'utils/const/GQL_QUERIES';
1918

2019
/*
@@ -75,12 +74,25 @@ const CartItemsContainer = () => {
7574
<CartItem
7675
key={item.productId}
7776
item={item}
77+
products={cart.products}
7878
// updateCartProcessing={updateCartProcessing}
79-
// products={cart.products}
8079
// handleRemoveProductClick={handleRemoveProductClick}
8180
// updateCart={updateCart}
8281
/>
8382
))}
83+
84+
<tr>
85+
<td>
86+
<Link href="/kasse">
87+
<a
88+
className="inline-block px-6 py-3 mt-6 text-xl leading-relaxed uppercase border border-gray-600 border-solid hover:underline"
89+
href="#"
90+
>
91+
gå til kasse
92+
</a>
93+
</Link>
94+
</td>
95+
</tr>
8496
</tbody>
8597
</table>
8698
</div>

components/Header/PageTitle.component.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ const PageTitle = ({ title, marginleft }) => {
22
return (
33
<>
44
{marginleft ? (
5-
<section className="container pl-6 mx-auto mt-24 bg-white">
6-
<span className="py-2 text-xl font-bold tracking-wide text-left text-gray-800 no-underline uppercase hover:no-underline">
5+
<section className="container pl-8 mx-auto mt-24 text-center bg-white">
6+
<span className="py-2 text-xl font-bold tracking-wide text-gray-800 no-underline uppercase hover:no-underline">
77
{title}
88
</span>
99
</section>
1010
) : (
11-
<section className="container pl-4 mx-auto mt-24 bg-white">
12-
<span className="py-2 text-xl font-bold tracking-wide text-left text-gray-800 no-underline uppercase hover:no-underline">
11+
<section className="container pl-4 mx-auto mt-24 text-center bg-white">
12+
<span className="py-2 text-xl font-bold tracking-wide text-gray-800 no-underline uppercase hover:no-underline">
1313
{title}
1414
</span>
1515
</section>

components/Index/Hero.component.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const Hero = () => {
1616
</h1>
1717

1818
<a
19-
className="inline-block px-6 py-3 text-xl leading-relaxed border border-gray-600 border-solid hover:underline"
19+
className="inline-block px-6 py-3 text-xl leading-relaxed uppercase border border-gray-600 border-solid hover:underline"
2020
href="#"
2121
>
2222
Kjøp Nå
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import CartItemsContainer from '../components/Cart/CartPage/CartItemsContainer.component';
22

3-
const Cart = () => {
3+
const Handlekurv = () => {
44
return (
55
<>
66
<CartItemsContainer />
77
</>
88
);
99
};
1010

11-
export default Cart;
11+
export default Handlekurv;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import CheckoutForm from '../components/Checkout/CheckoutForm.component';
22

3-
const Checkout = () => <CheckoutForm />;
3+
const Handlekurv = () => <CheckoutForm />;
44

5-
export default Checkout;
5+
export default Handlekurv;

pages/produkter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const Produkter = ({ products }) => {
1717

1818
return (
1919
<>
20-
<PageTitle title="Produkter" marginleft="true" />
20+
<PageTitle title="Produkter" marginleft="50" />
2121

2222
{products && <IndexProducts products={products} />}
2323

0 commit comments

Comments
 (0)