Skip to content

Commit

Permalink
[UPDATE] : product lists card and add slider image
Browse files Browse the repository at this point in the history
  • Loading branch information
mojtaba1180 committed Jun 2, 2023
1 parent f0cc2b7 commit 5c9fcf7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
Binary file added public/images/slide-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/slide-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/slide-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions src/components/product/card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable react/jsx-one-expression-per-line */
/* eslint-disable object-curly-newline */
import { Button } from "antd";
import { addCommas } from "@persian-tools/persian-tools";
import { Button, Divider } from "antd";
import { Link } from "react-router-dom";

interface Props {
Expand All @@ -13,9 +15,9 @@ function Card({ url, title, price, quantity, imageURL }: Props) {
return (
<Link
to={url}
className=" flex h-[220px] w-full flex-col overflow-hidden rounded-lg border-2 border-[var(--tg-theme-secondary-bg-color)]">
className=" flex h-[280px] w-full flex-col overflow-hidden rounded-lg border-2 border-[var(--tg-theme-secondary-bg-color)]">
<div
className=" ml-auto h-40 w-full bg-[var(--tg-theme-secondary-bg-color)] bg-cover bg-no-repeat "
className=" ml-auto h-[280px] w-full bg-[var(--tg-theme-secondary-bg-color)] bg-cover bg-no-repeat "
style={{ backgroundImage: `url('${imageURL}')` }}
/>
<div className="flex h-full w-full flex-col items-start justify-between gap-3 p-2">
Expand All @@ -29,7 +31,10 @@ function Card({ url, title, price, quantity, imageURL }: Props) {
</div>
<div className="select-none text-sm">غذا</div>
</div> */}
<div className="self-end text-right">قیمت :{price} تومان</div>
<Divider className="my-0 py-0" />
<div className="flex gap-2 self-end text-right text-sm">
<span>تومان</span> <span> {addCommas(price || 0)}</span>
</div>
{/* <div className="self-start text-left">تعداد :{quantity} عدد</div> */}
</div>
<Button className="w-full self-end" type="default">
Expand Down
19 changes: 6 additions & 13 deletions src/containers/hero-slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,12 @@ const contentStyle: React.CSSProperties = {

function HeroSlider() {
return (
<Carousel rootClassName="rounded-lg overflow-hidden " autoplay>
<div>
<h3 style={contentStyle}>1</h3>
</div>
<div>
<h3 style={contentStyle}>2</h3>
</div>
<div>
<h3 style={contentStyle}>3</h3>
</div>
<div>
<h3 style={contentStyle}>4</h3>
</div>
<Carousel rootClassName="rounded-lg overflow-hidden" autoplay>
{[1, 2, 3].map((_, idx) => (
<div className="h-[160px] w-full">
<img src={`/images/slide-${_}.jpg`} alt="slider" />
</div>
))}
</Carousel>
);
}
Expand Down

0 comments on commit 5c9fcf7

Please sign in to comment.