Skip to content

Commit 51311ba

Browse files
Copilotbenjuntilla
andauthored
Add back button to product detail page in soda shop (#82)
* Initial plan * Add back button to product detail page in soda shop Co-authored-by: benjuntilla <46634820+benjuntilla@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: benjuntilla <46634820+benjuntilla@users.noreply.github.com>
1 parent aeb48bd commit 51311ba

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/pages/Shop/ProductDetail.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useEffect, useState } from "react";
2-
import { useParams, useNavigate } from "react-router-dom";
2+
import { useParams, useNavigate, Link } from "react-router-dom";
33
import { Helmet } from "react-helmet-async";
4-
import { ShoppingCart } from "lucide-react";
4+
import { ShoppingCart, ArrowLeft } from "lucide-react";
55
import { storefrontAPI, Product } from "../../lib/api";
66
import { useCart } from "../../lib/CartContext";
77
import LoadingSpinner from "../../components/LoadingSpinner";
@@ -96,6 +96,13 @@ const ProductDetail: React.FC = () => {
9696
</Helmet>
9797
<div className="min-h-screen bg-black text-white pt-32">
9898
<div className="container mx-auto px-4 py-8">
99+
<Link
100+
to="/shop"
101+
className="inline-flex items-center text-gray-400 hover:text-white transition-colors mb-6"
102+
>
103+
<ArrowLeft size={20} className="mr-2" />
104+
Back to Shop
105+
</Link>
99106
<div className="grid md:grid-cols-2 gap-8">
100107
<div className="bg-zinc-900 rounded-lg overflow-hidden aspect-square relative">
101108
{product.image_url && !hasImageError ? (

0 commit comments

Comments
 (0)