fix: change height image
This commit is contained in:
@@ -2,15 +2,12 @@ import { useState } from "react";
|
|||||||
import Arrow from "../components/Arrow";
|
import Arrow from "../components/Arrow";
|
||||||
|
|
||||||
export default function CardItem({ item, onAddToCart }) {
|
export default function CardItem({ item, onAddToCart }) {
|
||||||
// Начальный вес — 100 грамм (0.100 кг)
|
|
||||||
const [weight, setWeight] = useState(0.1);
|
const [weight, setWeight] = useState(0.1);
|
||||||
|
|
||||||
// Увеличение веса с шагом 100 грамм
|
|
||||||
const handleIncrement = () => {
|
const handleIncrement = () => {
|
||||||
setWeight((prev) => parseFloat((prev + 0.1).toFixed(3)));
|
setWeight((prev) => parseFloat((prev + 0.1).toFixed(3)));
|
||||||
};
|
};
|
||||||
|
|
||||||
// Уменьшение веса (не позволяет опуститься ниже минимальных 100 грамм)
|
|
||||||
const handleDecrement = () => {
|
const handleDecrement = () => {
|
||||||
setWeight((prev) =>
|
setWeight((prev) =>
|
||||||
prev > 0.1 ? parseFloat((prev - 0.1).toFixed(3)) : 0.1,
|
prev > 0.1 ? parseFloat((prev - 0.1).toFixed(3)) : 0.1,
|
||||||
@@ -19,11 +16,11 @@ export default function CardItem({ item, onAddToCart }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col text-white w-full">
|
<div className="flex flex-col text-white w-full">
|
||||||
<div className="w-full rounded-md overflow-hidden bg-slate-800/60 flex flex-col h-100 items-center justify-center border border-slate-700/50 select-none">
|
<div className="w-full rounded-md overflow-hidden bg-slate-800/60 flex h-[400px] md:h-[600px] flex-col items-center justify-center border border-slate-700/50 select-none">
|
||||||
<img
|
<img
|
||||||
src={item.avatar_url}
|
src={item.avatar_url}
|
||||||
alt={item.name}
|
alt={item.name}
|
||||||
className="object-cover w-full h-150 object-center"
|
className="object-cover w-full h-[400px] md:h-[600px] object-center"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user