/
IvanWake
/
cookieStore
Обзор
Документация
Войти
/
IvanWake
/
cookieStore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/pages/Home.js
34 строки
1 KB
Ivan Wake
Add stores for Orders and Addresses
27 мар 2024, 07:16
27 мар 2024, 07:16
469ef2b
Код
Авторство
О чём код?
import { useCart } from "../store/cart-store"; import { motion, AnimatePresence } from "framer-motion"; import Header from "../components/Layout/Header"; import Main from "../components/Layout/Main"; import MainWrapper from "../components/Layout/MainWrapper"; import Cart from "../components/Cart/Cart"; import ProductList from "../components/Product/ProductList"; import Categories from "../components/Categories/Categories"; const Home = () => { const isCartVisible = useCart(state => state.isCartVisible); return ( <motion.div initial={{ opacity: 0 }} animate={{ height: 'auto', opacity: 1 }} style={{ overflow: 'hidden' }} transition={{ duration: .3 }} > <Header /> <Main> <MainWrapper> <Categories /> <ProductList /> </MainWrapper> <AnimatePresence> { isCartVisible && <Cart /> } </AnimatePresence> </Main> </motion.div> ); } export default Home;