diff --git a/components/Collections.tsx b/components/Collections.tsx index 50f2341..00039c0 100644 --- a/components/Collections.tsx +++ b/components/Collections.tsx @@ -1,63 +1,46 @@ -import { motion } from 'framer-motion'; -import Image from 'next/image'; -import Link from 'next/link'; +import Image from "next/image" +import Link from "next/link" +import { motion } from "framer-motion" +import { Collection } from "../data/collections" -// Типы для свойств компонента interface CollectionsProps { - collections: Collection[]; -} - -// Тип для коллекции -interface Collection { - id: number; - name: string; - image: string; - description: string; - url: string; + collections: Collection[] } export default function Collections({ collections }: CollectionsProps) { return ( -
-
- - Коллекции - - -
- {collections.map((collection, index) => ( +
+

Коллекции

+ +
+ {collections.map((collection, index) => ( + - -
- {collection.name} -
-
+
+ {collection.name} +
-

{collection.name}

-

{collection.description}

+

{collection.name}

+

{collection.description}

+ + Смотреть коллекцию +
- +
- ))} -
+ + ))}
- ); + ) } \ No newline at end of file diff --git a/components/Header.tsx b/components/Header.tsx index 2aa4928..21fbd7c 100644 --- a/components/Header.tsx +++ b/components/Header.tsx @@ -1,10 +1,12 @@ import Link from "next/link"; -import { Search, Heart, User, ShoppingCart } from "lucide-react"; +import { Search, Heart, User, ShoppingCart, ChevronLeft } from "lucide-react"; import { useState, useEffect } from "react"; import { motion } from "framer-motion"; import Image from "next/image"; +import { useRouter } from "next/router"; export default function Header() { + const router = useRouter(); // Состояние для отслеживания прокрутки страницы const [scrolled, setScrolled] = useState(false); @@ -23,33 +25,57 @@ export default function Header() { }; }, [scrolled]); + // Функция для возврата на предыдущую страницу + const goBack = () => { + router.back(); + }; + + // Проверяем, находимся ли мы на главной странице + const isHomePage = router.pathname === "/"; + // Проверяем, находимся ли мы на странице категорий или коллекций + const isDetailPage = router.pathname.includes("[slug]"); + return ( -
-