изменения
This commit is contained in:
1 parent
1cb9f9a509
commit
797d4a091f
22 files changed
+405
-53
No files matched your search
@@ -6,6 +6,12 @@
|
||||
.top {
|
||||
background: #000;
|
||||
padding: 15px 40px;
|
||||
padding-top: 100px;
|
||||
}
|
||||
|
||||
.short{
|
||||
margin-top: 30px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.back {
|
||||
@@ -33,15 +39,20 @@
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.rightContent{
|
||||
padding-right: 100px;
|
||||
|
||||
}
|
||||
|
||||
.right {
|
||||
flex: 1;
|
||||
background: linear-gradient(
|
||||
rgba(0, 0, 0, 0.7),
|
||||
rgba(0, 0, 0, 0.7)
|
||||
rgba(44, 44, 44, 0.9),
|
||||
rgba(44, 44, 44, 0.9)
|
||||
),
|
||||
url("/bg.jpg");
|
||||
url("../../assets/images/otkrytie-novogo-proizvodstva-v-g.Krymsk.jpeg");
|
||||
color: white;
|
||||
padding: 80px;
|
||||
padding: 90px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
||||
@@ -6,6 +6,8 @@ import styles from "./ItemPage.module.css";
|
||||
import type { CategoryAtributes, CategoryAtrVals } from "../../types/categories";
|
||||
import Button from "../../components/Button/Button";
|
||||
import PriceLisForm from "../../components/PriceLisForm/PriceLisForm";
|
||||
import ProductAttributes from "../../components/Table/ProducTable";
|
||||
import { p } from "framer-motion/client";
|
||||
|
||||
const ItemPage = () => {
|
||||
const { id } = useParams();
|
||||
@@ -39,10 +41,11 @@ const ItemPage = () => {
|
||||
|
||||
<div className={styles.hero}>
|
||||
<div className={styles.left}>
|
||||
<img src={product.image} alt={product.name} />
|
||||
<img src={product.images[0]} alt={product.name} />
|
||||
</div>
|
||||
|
||||
<div className={styles.right}>
|
||||
<div className={styles.rightContent}>
|
||||
<div className={styles.breadcrumbs}>
|
||||
ГЛАВНАЯ / {category?.name} / {product.name}
|
||||
</div>
|
||||
@@ -54,6 +57,7 @@ const ItemPage = () => {
|
||||
label="СКАЧАТЬ ПРАЙС-ЛИСТ"
|
||||
onClick={() => setOpen(true)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -77,13 +81,21 @@ const ItemPage = () => {
|
||||
<div>
|
||||
<h2>ОПИСАНИЕ</h2>
|
||||
<p>{product.description}</p>
|
||||
<p>{product.full_name}</p>
|
||||
{!product.inStock?
|
||||
(
|
||||
<p>в наличии</p>
|
||||
) : (
|
||||
<p>нет в наличии</p>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{activeTab === "chars" && (
|
||||
<div>
|
||||
<h2>ХАРАКТЕРИСТИКИ</h2>
|
||||
{category.atributes?.map((attr: CategoryAtributes) => (
|
||||
{/*{product.attributes.map((attr) => (
|
||||
<div key={attr.id} className={styles.attrRow}>
|
||||
<span>{attr.name}</span>
|
||||
{attr.vals?.map((val: CategoryAtrVals) => (
|
||||
@@ -92,7 +104,8 @@ const ItemPage = () => {
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
))}*/}
|
||||
<ProductAttributes attributes={product.attributes}/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@ const Layout = () =>{
|
||||
return(
|
||||
/*token ?*/ <div className="dashboard">
|
||||
<div className="content-wrapper">
|
||||
<Header />
|
||||
<Header />
|
||||
<main className={styles.content}>
|
||||
<Outlet />
|
||||
</main>
|
||||
|
||||
@@ -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);
|
||||
|
||||
return (
|
||||
<div className={styles.wrapper}>
|
||||
/*<div className={styles.wrapper}>
|
||||
<SidebarCategories />
|
||||
<div className={styles.content}>
|
||||
{!selectedCategoryId ? (
|
||||
@@ -29,6 +29,27 @@ const ProductsPage: React.FC = () => {
|
||||
</>
|
||||
)}
|
||||
</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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user