Skip to content

Commit

Permalink
[UPDATE] : update single product
Browse files Browse the repository at this point in the history
  • Loading branch information
mojtaba1180 committed Jun 2, 2023
1 parent 5c9fcf7 commit 2005d0e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pages/user/product/single.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { useEffect, useState } from "react";
import { useParams } from "react-router";

function ProductSingle() {
const [count, setcount] = useState(1);
const [count, setCount] = useState(1);
const { product_id } = useParams();
const mutation = useAddToCart();
const { id } = useTelegramUser();
Expand Down Expand Up @@ -54,8 +54,8 @@ function ProductSingle() {
);
};

const decriment = () => count > 1 && setcount(count - 1);
const incriment = () => count < 100 && setcount(count + 1);
const decriment = () => count > 1 && setCount(count - 1);
const incriment = () => count < 100 && setCount(count + 1);

return (
<Container title={data?.product_Name || ""} backwardUrl={-1}>
Expand All @@ -82,7 +82,7 @@ function ProductSingle() {
<div className="flex w-full justify-end">
<div>قیمت :{data?.price && addCommas(data?.price)} تومان</div>
</div>
<div className="my-4 flex gap-2">
<div className="my-4 flex flex-col gap-2">
<div className="flex w-44 items-center justify-center gap-2">
<Button
htmlType="button"
Expand All @@ -100,7 +100,7 @@ function ProductSingle() {
maxLength={2}
onChange={(e) => {
if (e > 1 || e < 100) {
setcount(e);
setCount(e);
}
}}
defaultValue={count}
Expand Down

0 comments on commit 2005d0e

Please sign in to comment.