добавил модалку с прайсформой
This commit is contained in:
1 parent
27523cb2a1
commit
ba921e8348
3 files changed
+11
-3
No files matched your search
@@ -4,9 +4,11 @@ import { useAppDispatch, useAppSelector } from "../../app/hooks";
|
||||
import { fetchProductById } from "../../features/catalog/productsSlice";
|
||||
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";
|
||||
|
||||
const ItemPage = () => {
|
||||
const { id } = useParams();
|
||||
const { id } = useParams();
|
||||
const dispatch = useAppDispatch();
|
||||
const navigate = useNavigate();
|
||||
const { items, loading } = useAppSelector((state) => state.products);
|
||||
@@ -14,6 +16,8 @@ const ItemPage = () => {
|
||||
|
||||
const [activeTab, setActiveTab] = useState<"desc" | "chars">("desc");
|
||||
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (id) dispatch(fetchProductById(id));
|
||||
}, [id]);
|
||||
@@ -26,6 +30,7 @@ const ItemPage = () => {
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<PriceLisForm open={open} onClose={() => setOpen(false)}/>
|
||||
<div className={styles.top}>
|
||||
<button className={styles.back} onClick={() => navigate(-1)}>
|
||||
← НАЗАД В КАТАЛОГ
|
||||
@@ -49,6 +54,10 @@ const ItemPage = () => {
|
||||
<button className={styles.download}>
|
||||
СКАЧАТЬ ПРАЙС-ЛИСТ
|
||||
</button>
|
||||
<Button
|
||||
label="СКАЧАТЬ ПРАЙС-ЛИСТ"
|
||||
onClick={() => setOpen(true)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in new issue
Block a user