изменения
This commit is contained in:
1 parent
1cb9f9a509
commit
797d4a091f
21 files changed
+404
-52
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 214 KiB |
@@ -13,7 +13,7 @@ font-size: 15px;
|
|||||||
|
|
||||||
|
|
||||||
.button:hover {
|
.button:hover {
|
||||||
background: #ffdf3e;
|
background: #ffe667;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,12 +22,12 @@ subtitle: "для ВНУТРЕННЕЙ канализации",
|
|||||||
image: category_interna2,
|
image: category_interna2,
|
||||||
highlight: true,
|
highlight: true,
|
||||||
},
|
},
|
||||||
/*{ id: 2, title: "СМАЗКИ СКОЛЬЖЕНИЯ", subtitle: "(ПАРАФИНЫ)", image: "/images/cat-paraffin.jpg" },
|
/*{ id: 2, title: "КОЛЕНА И ОТВОДЫ", image: "/images/cat-paraffin.jpg" },
|
||||||
{ id: 3, title: "МАЗИ ДЕРЖАНИЯ", image: "/images/cat-hold.jpg" },
|
{ id: 3, title: "ЗАГЛУШКИ И РЕВИЗИИ", image: "/images/cat-hold.jpg" },
|
||||||
{ id: 4, title: "СМЫВКА", image: "/images/cat-wash.jpg" },
|
{ id: 4, title: "ПЕРЕХОДЫ", image: "/images/cat-wash.jpg" },
|
||||||
{ id: 5, title: "СМОЛА", image: "/images/cat-resin.jpg" },
|
{ id: 5, title: "ТРОЙНИКИ", image: "/images/cat-resin.jpg" },
|
||||||
{ id: 6, title: "СКРЕБКИ", image: "/images/cat-scraper.jpg" },
|
{ id: 6, title: "МУФТЫ", image: "/images/cat-scraper.jpg" },
|
||||||
{ id: 7, title: "ПРОБКИ / РАСТИРКИ", image: "/images/cat-cork.jpg" },*/
|
{ id: 7, title: "ПЕРЕХОДЫ", image: "/images/cat-cork.jpg" },*/
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
title: "Труба ПВХ",
|
title: "Труба ПВХ",
|
||||||
@@ -35,8 +35,8 @@ subtitle: "для НАРУЖНОЙ канализации",
|
|||||||
highlight: true,
|
highlight: true,
|
||||||
image: category_internal1,
|
image: category_internal1,
|
||||||
},
|
},
|
||||||
/*{ id: 9, title: "СВЯЗКИ И СКРЕПКИ ДЛЯ ЛЫЖ", image: "/images/cat-straps.jpg" },
|
|
||||||
{ id: 10, title: "ЧЕХЛЫ, СУМКИ", image: "/images/cat-bags.jpg" },*/
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
.footer {
|
.footer {
|
||||||
color: #bfbfbf;
|
color: #bfbfbf;
|
||||||
background: #000;
|
background: #000;
|
||||||
padding: 60px 0;
|
padding: 40px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -17,13 +17,14 @@ justify-content: space-between;
|
|||||||
.left {
|
.left {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 25px;
|
gap: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
width: 160px;
|
width: 60px;
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
|
border-radius: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import styles from "./Footer.module.css";
|
import styles from "./Footer.module.css";
|
||||||
import { NavLink } from "react-router-dom";
|
import { NavLink } from "react-router-dom";
|
||||||
|
import blackLogo from '../../assets/images/BlackLogo.jpg'
|
||||||
|
|
||||||
const Footer: React.FC = () => {
|
const Footer: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<footer className={styles.footer}>
|
<footer className={styles.footer}>
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<div className={styles.left}>
|
<div className={styles.left}>
|
||||||
<img src="/images/logo-footer.png" alt="logo" className={styles.logo} />
|
<img src={blackLogo} alt="logo" className={styles.logo} />
|
||||||
<span className={styles.copy}>ТРК Спринт. 2017-2025 ©</span>
|
<span className={styles.copy}>РК Plastic. 2015-2026 ©</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const Header = () =>{
|
|||||||
<div className={styles.headeLogo}>
|
<div className={styles.headeLogo}>
|
||||||
<img src={logo} alt="logo" className={styles.logoImage}/>
|
<img src={logo} alt="logo" className={styles.logoImage}/>
|
||||||
<div className={styles.phoneBlock}>
|
<div className={styles.phoneBlock}>
|
||||||
<a href="" className={styles.phoneBlock}>+7 905 010 58 40</a>
|
<a href="" className={styles.phoneBlock}>+7 910 121 09 62</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.headerNav}>
|
<div className={styles.headerNav}>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const QuestionsBlock: React.FC = () => {
|
|||||||
<div className={styles.right}>
|
<div className={styles.right}>
|
||||||
<div className={styles.phoneBlock}>
|
<div className={styles.phoneBlock}>
|
||||||
<PhoneOutlined className={styles.phoneIcon} />
|
<PhoneOutlined className={styles.phoneIcon} />
|
||||||
<span className={styles.phoneNumber}>8 800 707 25 58</span>
|
<span className={styles.phoneNumber}>+7 910 121 09 62</span>
|
||||||
|
|
||||||
<div className={styles.phoneInfo}>
|
<div className={styles.phoneInfo}>
|
||||||
Звоните с понедельника по пятницу <br /> c 09:00 до 18:00 (по Москве)
|
Звоните с понедельника по пятницу <br /> c 09:00 до 18:00 (по Москве)
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import styles from "./Table.module.css";
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
attributes: Record<string, any>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatKey = (key: string) =>
|
||||||
|
key
|
||||||
|
.replace(/_/g, " ")
|
||||||
|
.replace(/\b\w/g, (l) => l.toUpperCase());
|
||||||
|
|
||||||
|
const ProductAttributes: React.FC<Props> = ({ attributes }) => {
|
||||||
|
const rows = Object.entries(attributes).filter(
|
||||||
|
([key, value]) =>
|
||||||
|
key !== "categoryId" &&
|
||||||
|
value !== null &&
|
||||||
|
value !== undefined &&
|
||||||
|
String(value).trim() !== ""
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={styles.wrapper}>
|
||||||
|
{rows.map(([key, value]) => (
|
||||||
|
<div key={`${key}-${value}`} className={styles.row}>
|
||||||
|
<span className={styles.name}>
|
||||||
|
{formatKey(key)}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span className={styles.dots} />
|
||||||
|
|
||||||
|
<span className={styles.value}>
|
||||||
|
{value}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ProductAttributes;
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
.wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* строка */
|
||||||
|
.row {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
font-size: 14px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* название */
|
||||||
|
.name {
|
||||||
|
color: #666;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* пунктир */
|
||||||
|
.dots {
|
||||||
|
flex: 1;
|
||||||
|
border-bottom: 1px dotted #ccc;
|
||||||
|
margin: 0 8px;
|
||||||
|
transform: translateY(-4px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* значение */
|
||||||
|
.value {
|
||||||
|
font-weight: 500;
|
||||||
|
color: #000;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* hover как в маркетплейсах */
|
||||||
|
.row:hover .name {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row:hover .dots {
|
||||||
|
border-color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* мобильная версия */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.row {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dots {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -60,7 +60,7 @@ const PhoneRequest: React.FC<Props> = ({ onSend }) => {
|
|||||||
await onSend(phone);
|
await onSend(phone);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
await client.post("/api/contact/send-phone/", { phone });
|
await client.post("/email/", { phone });
|
||||||
}
|
}
|
||||||
|
|
||||||
setSuccess(true);
|
setSuccess(true);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
.grid {
|
.grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(30%, 1fr));
|
||||||
gap: 24px;
|
gap: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
transition: all 0.3s;
|
transition: all 0.3s;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.card:hover {
|
.card:hover {
|
||||||
@@ -60,7 +61,7 @@
|
|||||||
.list { list-style:none; padding:0; margin:0; }
|
.list { list-style:none; padding:0; margin:0; }
|
||||||
.item { padding:8px 0; color:#666; cursor:pointer; transition:color .15s; }
|
.item { padding:8px 0; color:#666; cursor:pointer; transition:color .15s; }
|
||||||
.item:hover { color:#000; }
|
.item:hover { color:#000; }
|
||||||
.active { color:#000; font-weight:700; }
|
.activeCat { color:#000; font-weight:700; }
|
||||||
/*SidebarCategories*/
|
/*SidebarCategories*/
|
||||||
|
|
||||||
/*Pagination*/
|
/*Pagination*/
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
import styles from "./Catalog.module.css";
|
|
||||||
import { useAppSelector } from "../../app/hooks";
|
|
||||||
|
|
||||||
interface Props { onSelect?: (id:number) => void }
|
|
||||||
const CategoryCards: React.FC<Props> = ({ onSelect }) => {
|
|
||||||
const categories = useAppSelector(s => s.categories.items);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={styles.categoryGrid}>
|
|
||||||
{categories.map(c => (
|
|
||||||
<div key={c.id} className={styles.categoryGard} onClick={() => onSelect?.(c.id)}>
|
|
||||||
{c.image ? <img src={c.image} alt={c.name} className={styles.categoryImg} /> : <img src="/mnt/data/c9552f5e-1741-4845-8d5f-9d438f068636.png" alt={c.name} className={styles.categoryImg} />}
|
|
||||||
<div className={styles.categoryName}>{c.name}</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default CategoryCards;
|
|
||||||
@@ -2,6 +2,7 @@ import React from "react";
|
|||||||
import type { Product } from "../../types/product";
|
import type { Product } from "../../types/product";
|
||||||
import styles from "./Catalog.module.css";
|
import styles from "./Catalog.module.css";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { setSelectedProducts } from "./productsSlice";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
product: Product;
|
product: Product;
|
||||||
@@ -10,12 +11,17 @@ interface Props {
|
|||||||
const ProductCard: React.FC<Props> = ({ product }) => {
|
const ProductCard: React.FC<Props> = ({ product }) => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const onSelect = (prodId: number) => {
|
||||||
|
navigate(`/product/${product.id}`);
|
||||||
|
setSelectedProducts(prodId);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={styles.card}
|
className={styles.card}
|
||||||
onClick={() => navigate(`/product/${product.id}`)}
|
onClick={() => onSelect(product.id)}
|
||||||
>
|
>
|
||||||
<img src={product.image} alt={product.name} />
|
<img src={product.images[0]} alt={product.name} />
|
||||||
<p className={styles.name}>{product.name}</p>
|
<p className={styles.name}>{product.name}</p>
|
||||||
<button className={styles.plus}>+</button>
|
<button className={styles.plus}>+</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const SidebarCategories: React.FC = () => {
|
|||||||
<ul className={styles.list}>
|
<ul className={styles.list}>
|
||||||
{items.map(cat => (
|
{items.map(cat => (
|
||||||
<li key={cat.id}
|
<li key={cat.id}
|
||||||
className={`${styles.item} ${selectedCategoryId === cat.id ? styles.active : ""}`}
|
className={`${styles.item} ${selectedCategoryId === cat.id ? styles.activeCat : ""}`}
|
||||||
onClick={() => onClick(cat.id)}>
|
onClick={() => onClick(cat.id)}>
|
||||||
{cat.name}
|
{cat.name}
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ interface ProductsState {
|
|||||||
loading: boolean;
|
loading: boolean;
|
||||||
error: string | null;
|
error: string | null;
|
||||||
filtersApplied: Record<string, (string|number)[]>;
|
filtersApplied: Record<string, (string|number)[]>;
|
||||||
|
selectedProductId: number | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const initialState: ProductsState = {
|
const initialState: ProductsState = {
|
||||||
@@ -64,12 +65,16 @@ const initialState: ProductsState = {
|
|||||||
loading: false,
|
loading: false,
|
||||||
error: null,
|
error: null,
|
||||||
filtersApplied: {},
|
filtersApplied: {},
|
||||||
|
selectedProductId: null
|
||||||
};
|
};
|
||||||
|
|
||||||
const slice = createSlice({
|
const slice = createSlice({
|
||||||
name: "products",
|
name: "products",
|
||||||
initialState,
|
initialState,
|
||||||
reducers: {
|
reducers: {
|
||||||
|
setSelectedProducts(state, action: PayloadAction<number>){
|
||||||
|
state.selectedProductId = action.payload;
|
||||||
|
},
|
||||||
setPage(state, action: PayloadAction<number>) {
|
setPage(state, action: PayloadAction<number>) {
|
||||||
state.page = action.payload;
|
state.page = action.payload;
|
||||||
},
|
},
|
||||||
@@ -105,5 +110,5 @@ const slice = createSlice({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export const { setPage, setLimit, setFilters, resetProducts } = slice.actions;
|
export const { setPage, setLimit, setFilters, resetProducts, setSelectedProducts } = slice.actions;
|
||||||
export default slice.reducer;
|
export default slice.reducer;
|
||||||
@@ -6,6 +6,12 @@
|
|||||||
.top {
|
.top {
|
||||||
background: #000;
|
background: #000;
|
||||||
padding: 15px 40px;
|
padding: 15px 40px;
|
||||||
|
padding-top: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.short{
|
||||||
|
margin-top: 30px;
|
||||||
|
margin-bottom: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.back {
|
.back {
|
||||||
@@ -33,15 +39,20 @@
|
|||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.rightContent{
|
||||||
|
padding-right: 100px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
rgba(0, 0, 0, 0.7),
|
rgba(44, 44, 44, 0.9),
|
||||||
rgba(0, 0, 0, 0.7)
|
rgba(44, 44, 44, 0.9)
|
||||||
),
|
),
|
||||||
url("/bg.jpg");
|
url("../../assets/images/otkrytie-novogo-proizvodstva-v-g.Krymsk.jpeg");
|
||||||
color: white;
|
color: white;
|
||||||
padding: 80px;
|
padding: 90px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import styles from "./ItemPage.module.css";
|
|||||||
import type { CategoryAtributes, CategoryAtrVals } from "../../types/categories";
|
import type { CategoryAtributes, CategoryAtrVals } from "../../types/categories";
|
||||||
import Button from "../../components/Button/Button";
|
import Button from "../../components/Button/Button";
|
||||||
import PriceLisForm from "../../components/PriceLisForm/PriceLisForm";
|
import PriceLisForm from "../../components/PriceLisForm/PriceLisForm";
|
||||||
|
import ProductAttributes from "../../components/Table/ProducTable";
|
||||||
|
import { p } from "framer-motion/client";
|
||||||
|
|
||||||
const ItemPage = () => {
|
const ItemPage = () => {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
@@ -39,10 +41,11 @@ const ItemPage = () => {
|
|||||||
|
|
||||||
<div className={styles.hero}>
|
<div className={styles.hero}>
|
||||||
<div className={styles.left}>
|
<div className={styles.left}>
|
||||||
<img src={product.image} alt={product.name} />
|
<img src={product.images[0]} alt={product.name} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.right}>
|
<div className={styles.right}>
|
||||||
|
<div className={styles.rightContent}>
|
||||||
<div className={styles.breadcrumbs}>
|
<div className={styles.breadcrumbs}>
|
||||||
ГЛАВНАЯ / {category?.name} / {product.name}
|
ГЛАВНАЯ / {category?.name} / {product.name}
|
||||||
</div>
|
</div>
|
||||||
@@ -54,6 +57,7 @@ const ItemPage = () => {
|
|||||||
label="СКАЧАТЬ ПРАЙС-ЛИСТ"
|
label="СКАЧАТЬ ПРАЙС-ЛИСТ"
|
||||||
onClick={() => setOpen(true)}
|
onClick={() => setOpen(true)}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -77,13 +81,21 @@ const ItemPage = () => {
|
|||||||
<div>
|
<div>
|
||||||
<h2>ОПИСАНИЕ</h2>
|
<h2>ОПИСАНИЕ</h2>
|
||||||
<p>{product.description}</p>
|
<p>{product.description}</p>
|
||||||
|
<p>{product.full_name}</p>
|
||||||
|
{!product.inStock?
|
||||||
|
(
|
||||||
|
<p>в наличии</p>
|
||||||
|
) : (
|
||||||
|
<p>нет в наличии</p>
|
||||||
|
)
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{activeTab === "chars" && (
|
{activeTab === "chars" && (
|
||||||
<div>
|
<div>
|
||||||
<h2>ХАРАКТЕРИСТИКИ</h2>
|
<h2>ХАРАКТЕРИСТИКИ</h2>
|
||||||
{category.atributes?.map((attr: CategoryAtributes) => (
|
{/*{product.attributes.map((attr) => (
|
||||||
<div key={attr.id} className={styles.attrRow}>
|
<div key={attr.id} className={styles.attrRow}>
|
||||||
<span>{attr.name}</span>
|
<span>{attr.name}</span>
|
||||||
{attr.vals?.map((val: CategoryAtrVals) => (
|
{attr.vals?.map((val: CategoryAtrVals) => (
|
||||||
@@ -92,7 +104,8 @@ const ItemPage = () => {
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}*/}
|
||||||
|
<ProductAttributes attributes={product.attributes}/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,207 @@
|
|||||||
|
/* ===== ОБЩИЙ ЛЭЙАУТ ===== */
|
||||||
|
.wrapper {
|
||||||
|
display: flex;
|
||||||
|
margin: 0;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container{
|
||||||
|
display: flex;
|
||||||
|
background: #f3f3f3;
|
||||||
|
min-height: 100vh;
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== САЙДБАР ===== */
|
||||||
|
.sidebar {
|
||||||
|
width: 280px;
|
||||||
|
background: #fff;
|
||||||
|
padding: 30px 20px;
|
||||||
|
border-right: 1px solid #e0e0e0;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding-top: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== ОСНОВНАЯ ЧАСТЬ ===== */
|
||||||
|
.main {
|
||||||
|
flex: 1;
|
||||||
|
padding: 30px 40px;
|
||||||
|
padding-top: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== ЛЭЙАУТ КАТАЛОГА ===== */
|
||||||
|
.catalogLayout {
|
||||||
|
display: flex;
|
||||||
|
gap: 30px;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== ФИЛЬТРЫ ===== */
|
||||||
|
.filters {
|
||||||
|
width: 100%; /* 🔥 важно */
|
||||||
|
border: 1px solid #e5e5e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== БЛОК ТОВАРОВ ===== */
|
||||||
|
.products {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== GRID ===== */
|
||||||
|
.grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
border-top: 1px solid #ddd;
|
||||||
|
border-left: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== КАРТОЧКА ===== */
|
||||||
|
.card {
|
||||||
|
background: #fff;
|
||||||
|
border-right: 1px solid #ddd;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
padding: 25px 20px;
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card:hover {
|
||||||
|
box-shadow: 0 8px 20px rgba(0,0,0,0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== КАРТИНКА ===== */
|
||||||
|
.card img {
|
||||||
|
max-height: 140px;
|
||||||
|
object-fit: contain;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== НАЗВАНИЕ ===== */
|
||||||
|
.card h3 {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #222;
|
||||||
|
min-height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== ПЛЮС КНОПКА ===== */
|
||||||
|
.card::after {
|
||||||
|
content: "+";
|
||||||
|
position: absolute;
|
||||||
|
right: 15px;
|
||||||
|
bottom: 15px;
|
||||||
|
color: #f5c400;
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== ПАГИНАЦИЯ ===== */
|
||||||
|
.pagination {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pageBtn {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
background: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pageBtn:hover {
|
||||||
|
background: #f5c400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activePage {
|
||||||
|
background: #f5c400;
|
||||||
|
border-color: #f5c400;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== ФИЛЬТРЫ СТИЛИ ===== */
|
||||||
|
.filters h4 {
|
||||||
|
font-size: 14px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filters label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
font-size: 13px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filters input {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== КАТЕГОРИИ ===== */
|
||||||
|
.sidebar h3 {
|
||||||
|
font-size: 16px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar ul {
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li {
|
||||||
|
font-size: 14px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #666;
|
||||||
|
transition: 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar li:hover {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activeCategory {
|
||||||
|
font-weight: 700;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== АДАПТИВ ===== */
|
||||||
|
@media (max-width: 1200px) {
|
||||||
|
.grid {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.wrapper {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.catalogLayout {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filters {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@ const ProductsPage: React.FC = () => {
|
|||||||
const { selectedCategoryId } = useAppSelector(s => s.categories);
|
const { selectedCategoryId } = useAppSelector(s => s.categories);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.wrapper}>
|
/*<div className={styles.wrapper}>
|
||||||
<SidebarCategories />
|
<SidebarCategories />
|
||||||
<div className={styles.content}>
|
<div className={styles.content}>
|
||||||
{!selectedCategoryId ? (
|
{!selectedCategoryId ? (
|
||||||
@@ -29,6 +29,27 @@ const ProductsPage: React.FC = () => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</div>*/
|
||||||
|
<div className={styles.wrapper}>
|
||||||
|
<div className={styles.container}>
|
||||||
|
<aside className={styles.sidebar}>
|
||||||
|
<SidebarCategories />
|
||||||
|
|
||||||
|
{/* 👇 ВОТ СЮДА ПЕРЕНЕСИ */}
|
||||||
|
{selectedCategoryId && <Filters />}
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<main className={styles.main}>
|
||||||
|
{!selectedCategoryId ? (
|
||||||
|
<CategoryCards />
|
||||||
|
) : (
|
||||||
|
<div className={styles.products}>
|
||||||
|
<ProductGrid />
|
||||||
|
<Pagination categoryId={selectedCategoryId} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
export interface Product {
|
export interface Product {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
image: string;
|
|
||||||
description: string;
|
description: string;
|
||||||
|
images: string[];
|
||||||
|
inStock: boolean;
|
||||||
|
price: number | null;
|
||||||
|
attributes: Record<string, string | number | null>;
|
||||||
|
categoryId?: number;
|
||||||
|
created_at: string;
|
||||||
|
full_name: string;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user