-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from 202306-NEA-DZ-FEW/8-feature-shopping-card
feat(shoppingcard component): create a reusable card component
- Loading branch information
Showing
6 changed files
with
152 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import Link from "next/link" | ||
import StarRating from "../Rating/StarRating" | ||
|
||
export default function ShoppingCard({ product }) { | ||
return ( | ||
<Link href={`/products/${product.id}`}> | ||
<div | ||
className="card w-90 bg-white glass border-gold-g " | ||
style={{ minHeight: "450px" }} | ||
key={product.id} | ||
> | ||
<figure> | ||
<img | ||
src={product.image} | ||
alt={product.title} | ||
style={{ width: "60%", height: "250px", padding: "1rem" }} | ||
/> | ||
</figure> | ||
<div className="card-body text-center"> | ||
<h2 className="card-title text-text-brown mb-2 "> | ||
{product.title.length > 25 | ||
? `${product.title.slice(0, 25)}...` | ||
: product.title} | ||
</h2> | ||
<StarRating rating={product.rating.rate} /> | ||
|
||
<div className="flex flex-wrap items-start gap-16 "> | ||
<button className="btn bg-buttongold text-brown-text-brown px-4 py-2 hover:bg-buttongoldhov border border-brown-100 btn-xs sm:btn-sm md:btn-sm lg:btn-sm"> | ||
add to cart | ||
</button> | ||
<p className="font-bold text-xl">{product.price}$</p> | ||
</div> | ||
</div> | ||
</div> | ||
</Link> | ||
) | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
import Filter from "@/components/Filter/Filter" | ||
import Image from "next/image" | ||
import AllProducts from "./products" | ||
|
||
export default function Home() { | ||
return <h1>hi</h1> | ||
return ( | ||
<> | ||
{/* <Filter /> */} | ||
<AllProducts /> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.