diff --git a/src/app/globals.css b/src/app/globals.css index ae0c3bb..297d0a5 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -380,3 +380,14 @@ 0 0 40px rgba(192, 132, 252, 0.25); } } + +/* Убираем стрелки у input[type="number"] */ +input[type="number"]::-webkit-outer-spin-button, +input[type="number"]::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} + +input[type="number"] { + -moz-appearance: textfield; +} diff --git a/src/components/supplies/create-supply-page.tsx b/src/components/supplies/create-supply-page.tsx index 631bbe4..684edca 100644 --- a/src/components/supplies/create-supply-page.tsx +++ b/src/components/supplies/create-supply-page.tsx @@ -403,7 +403,7 @@ export function CreateSupplyPage() { )} -
+
{mockProducts.map((product) => { const selectedQuantity = getSelectedQuantity(product.id) const discountedPrice = product.discount @@ -419,34 +419,22 @@ export function CreateSupplyPage() { className="w-full h-full object-cover group-hover:scale-110 transition-transform duration-500" /> - {/* Badges в верхних углах */} -
- {product.isNew && ( - - - NEW - - )} - {product.isBestseller && ( - - - ХИТ - - )} - {product.discount && ( - - -{product.discount}% - - )} -
- {/* Количество в наличии */} -
- 50 ? 'bg-green-500/80' : product.quantity > 10 ? 'bg-yellow-500/80' : 'bg-red-500/80'} text-white border-0 backdrop-blur`}> - {product.quantity} шт +
+ 50 ? 'bg-green-500/80' : product.quantity > 10 ? 'bg-yellow-500/80' : 'bg-red-500/80'} text-white border-0 backdrop-blur text-xs`}> + {product.quantity}
+ {/* Discount badge */} + {product.discount && ( +
+ + -{product.discount}% + +
+ )} + {/* Overlay с кнопками */}
@@ -460,123 +448,102 @@ export function CreateSupplyPage() {
-
+
{/* Заголовок и бренд */}
-
+
{product.brand && ( {product.brand} )} - - {product.category} - + {product.isNew && ( + + NEW + + )} + {product.isBestseller && ( + + ХИТ + + )}
-

+

{product.name}

-

- Артикул: {product.article} -

- {/* Описание */} -

- {product.description} -

- - {/* Характеристики */} -
- {product.color && ( -
-
- Цвет: {product.color} -
- )} - {product.size && ( -
- Размер: {product.size} -
- )} - {product.weight && ( -
- Вес: {product.weight} г -
- )} + {/* Основная характеристика */} +
+ {product.color && {product.color}} + {product.size && {product.size}}
{/* Цена */} -
-
-
-
- {formatCurrency(discountedPrice)} -
- {product.discount && ( -
- {formatCurrency(product.price)} -
- )} +
+
+
+ {formatCurrency(discountedPrice)}
-
за штуку
+ {product.discount && ( +
+ {formatCurrency(product.price)} +
+ )}
{/* Управление количеством */} -
-
- - { - const value = Math.max(0, Math.min(product.quantity, parseInt(e.target.value) || 0)) - updateProductQuantity(product.id, value) - }} - className="h-9 w-16 text-center bg-white/10 border-white/20 text-white text-sm" - min={0} - max={product.quantity} - /> - -
+
+ + { + const value = e.target.value.replace(/[^0-9]/g, '') + const numValue = Math.max(0, Math.min(product.quantity, parseInt(value) || 0)) + updateProductQuantity(product.id, numValue) + }} + onFocus={(e) => e.target.select()} + className="h-8 w-12 text-center bg-white/10 border border-white/20 text-white text-sm rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none" + /> + {selectedQuantity > 0 && ( - + )}
{/* Сумма для выбранного товара */} {selectedQuantity > 0 && ( -
-
- Сумма: {formatCurrency(discountedPrice * selectedQuantity)} +
+
+ {formatCurrency(discountedPrice * selectedQuantity)} {product.discount && ( - - (экономия {formatCurrency((product.price - discountedPrice) * selectedQuantity)}) - +
+ экономия {formatCurrency((product.price - discountedPrice) * selectedQuantity)} +
)}