diff --git a/package-lock.json b/package-lock.json index e168c98..50858fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "marine-travel", "version": "0.1.0", "dependencies": { + "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-navigation-menu": "^1.2.14", "@radix-ui/react-popover": "^1.1.15", "@radix-ui/react-select": "^2.2.6", @@ -2865,6 +2866,42 @@ } } }, + "node_modules/@radix-ui/react-dialog": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.1.15.tgz", + "integrity": "sha512-TCglVRtzlffRNxRMEyR36DGBLJpeusFcgMVD9PZEzAKnUs1lKCgX5u9BmC2Yg+LL9MgZDugFFs1Vl+Jp4t/PGw==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.3", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-dismissable-layer": "1.1.11", + "@radix-ui/react-focus-guards": "1.1.3", + "@radix-ui/react-focus-scope": "1.1.7", + "@radix-ui/react-id": "1.1.1", + "@radix-ui/react-portal": "1.1.9", + "@radix-ui/react-presence": "1.1.5", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-slot": "1.2.3", + "@radix-ui/react-use-controllable-state": "1.2.2", + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.6.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-direction": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.1.1.tgz", diff --git a/package.json b/package.json index c6544f8..9e32114 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "lint": "eslint" }, "dependencies": { + "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-navigation-menu": "^1.2.14", "@radix-ui/react-popover": "^1.1.15", "@radix-ui/react-select": "^2.2.6", diff --git a/public/images/featured-yacht/featured1.png b/public/images/featured-yacht/featured1.png new file mode 100644 index 0000000..05526a0 Binary files /dev/null and b/public/images/featured-yacht/featured1.png differ diff --git a/public/images/featured-yacht/featured10.png b/public/images/featured-yacht/featured10.png new file mode 100644 index 0000000..d488f0e Binary files /dev/null and b/public/images/featured-yacht/featured10.png differ diff --git a/public/images/featured-yacht/featured2.png b/public/images/featured-yacht/featured2.png new file mode 100644 index 0000000..c2bff86 Binary files /dev/null and b/public/images/featured-yacht/featured2.png differ diff --git a/public/images/featured-yacht/featured3.png b/public/images/featured-yacht/featured3.png new file mode 100644 index 0000000..982c437 Binary files /dev/null and b/public/images/featured-yacht/featured3.png differ diff --git a/public/images/featured-yacht/featured4.png b/public/images/featured-yacht/featured4.png new file mode 100644 index 0000000..04a0e68 Binary files /dev/null and b/public/images/featured-yacht/featured4.png differ diff --git a/public/images/featured-yacht/featured5.png b/public/images/featured-yacht/featured5.png new file mode 100644 index 0000000..0782781 Binary files /dev/null and b/public/images/featured-yacht/featured5.png differ diff --git a/public/images/featured-yacht/featured6.png b/public/images/featured-yacht/featured6.png new file mode 100644 index 0000000..d488f0e Binary files /dev/null and b/public/images/featured-yacht/featured6.png differ diff --git a/public/images/featured-yacht/featured7.png b/public/images/featured-yacht/featured7.png new file mode 100644 index 0000000..982c437 Binary files /dev/null and b/public/images/featured-yacht/featured7.png differ diff --git a/public/images/featured-yacht/featured8.png b/public/images/featured-yacht/featured8.png new file mode 100644 index 0000000..04a0e68 Binary files /dev/null and b/public/images/featured-yacht/featured8.png differ diff --git a/public/images/featured-yacht/featured9.png b/public/images/featured-yacht/featured9.png new file mode 100644 index 0000000..0782781 Binary files /dev/null and b/public/images/featured-yacht/featured9.png differ diff --git a/src/app/components/FeaturedYacht.tsx b/src/app/components/FeaturedYacht.tsx index b56dbfa..e1f6035 100644 --- a/src/app/components/FeaturedYacht.tsx +++ b/src/app/components/FeaturedYacht.tsx @@ -1,3 +1,5 @@ +"use client"; + import { Card, CardContent } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { DatePicker } from "@/components/ui/date-picker"; @@ -8,8 +10,16 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; +import { + Carousel, + CarouselContent, + CarouselItem, + CarouselNext, + CarouselPrevious, +} from "@/components/ui/carousel"; import Image from "next/image"; import Icon from "@/components/ui/icon"; +import { useState } from "react"; const yacht = { name: "Яхта", @@ -17,19 +27,30 @@ const yacht = { price: "от 18 000 ₽", perTime: "/ час", feet: "7 Футов", - mainImage: "/images/yacht.jpg", + mainImage: "/images/featured-yacht/featured1.png", thumbnails: [ - "/images/yacht.jpg", - "/images/another-yacht.jpg", - "/images/yacht.jpg", - "/images/another-yacht.jpg", - "/images/yacht.jpg", + "/images/featured-yacht/featured1.png", + "/images/featured-yacht/featured2.png", + "/images/featured-yacht/featured3.png", + "/images/featured-yacht/featured4.png", + "/images/featured-yacht/featured5.png", + "/images/featured-yacht/featured6.png", + "/images/featured-yacht/featured7.png", + "/images/featured-yacht/featured8.png", + "/images/featured-yacht/featured9.png", + "/images/featured-yacht/featured10.png", ], isPromoted: true, totalPrice: "0 ₽", }; export default function FeaturedYacht() { + const [selectedImage, setSelectedImage] = useState(yacht.mainImage); + + const handleThumbnailClick = (imageSrc: string) => { + setSelectedImage(imageSrc); + }; + return (
@@ -53,44 +74,59 @@ export default function FeaturedYacht() { {/* Main yacht image */}
{yacht.name}
- {/* Thumbnail images */} -
- {yacht.thumbnails.map( - (thumb, idx) => ( -
- {`${ -
- ) - )} + {/* Thumbnail images carousel */} +
+ + + {yacht.thumbnails.map((thumb, idx) => ( + +
+ {`${yacht.name} + handleThumbnailClick(thumb) + } + /> +
+
+ ))} +
+ + +
{/* Promoted badge */} {yacht.isPromoted && (
-
Это объявление продвигается.{" "} @@ -116,8 +152,7 @@ export default function FeaturedYacht() { }} > - Заметнее других — бронируют - быстрее + Заметнее других — бронируют быстрее
@@ -179,9 +214,7 @@ export default function FeaturedYacht() { Итого: - - {yacht.totalPrice} - + {yacht.totalPrice}
diff --git a/src/app/components/Hero.tsx b/src/app/components/Hero.tsx index a75c48c..d26f541 100644 --- a/src/app/components/Hero.tsx +++ b/src/app/components/Hero.tsx @@ -41,7 +41,7 @@ export default function Hero() { {/* Кнопка для мобильных устройств */}
-
diff --git a/src/app/components/Reviews.tsx b/src/app/components/Reviews.tsx index 29a0cfb..bf6f830 100644 --- a/src/app/components/Reviews.tsx +++ b/src/app/components/Reviews.tsx @@ -1,4 +1,9 @@ +"use client"; + import Image from "next/image"; +import { useState } from "react"; +import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog"; +import { Button } from "@/components/ui/button"; const reviewCategories = [ { @@ -44,6 +49,12 @@ const reviewCategories = [ ]; export default function Reviews() { + const [isDialogOpen, setIsDialogOpen] = useState(false); + + const handleCardClick = () => { + setIsDialogOpen(true); + }; + return (
@@ -55,6 +66,7 @@ export default function Reviews() {
))}
+ + {/* Диалог */} + + + {/* Кнопка закрытия */} + + + {/* Пустое пространство для выталкивания контента вниз */} +
+ + {/* Нижняя секция с текстом и кнопкой */} +
+
+ + Тема + +

Текст

+
+ + {/* Кнопка с градиентом */} + +
+
+
); diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx new file mode 100644 index 0000000..1647513 --- /dev/null +++ b/src/components/ui/dialog.tsx @@ -0,0 +1,122 @@ +"use client" + +import * as React from "react" +import * as DialogPrimitive from "@radix-ui/react-dialog" +import { X } from "lucide-react" + +import { cn } from "@/lib/utils" + +const Dialog = DialogPrimitive.Root + +const DialogTrigger = DialogPrimitive.Trigger + +const DialogPortal = DialogPrimitive.Portal + +const DialogClose = DialogPrimitive.Close + +const DialogOverlay = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DialogOverlay.displayName = DialogPrimitive.Overlay.displayName + +const DialogContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + + {children} + + + Close + + + +)) +DialogContent.displayName = DialogPrimitive.Content.displayName + +const DialogHeader = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+) +DialogHeader.displayName = "DialogHeader" + +const DialogFooter = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+) +DialogFooter.displayName = "DialogFooter" + +const DialogTitle = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DialogTitle.displayName = DialogPrimitive.Title.displayName + +const DialogDescription = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DialogDescription.displayName = DialogPrimitive.Description.displayName + +export { + Dialog, + DialogPortal, + DialogOverlay, + DialogTrigger, + DialogClose, + DialogContent, + DialogHeader, + DialogFooter, + DialogTitle, + DialogDescription, +}