386 lines
16 KiB
JavaScript
386 lines
16 KiB
JavaScript
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
import { B as Button, e as about, f as artOfWeaving } from "./index-CY6fYws-.js";
|
|
import { u as useTranslations, i as index, L as Layout } from "./layout-toNsB0Jp.js";
|
|
import { Link, useForm, Head } from "@inertiajs/react";
|
|
import { MoveRightIcon, Star, MoveRight } from "lucide-react";
|
|
import { Navigation, Pagination } from "swiper/modules";
|
|
import { Swiper, SwiperSlide } from "swiper/react";
|
|
import { D as Dialog, a as DialogTrigger, b as DialogContent, g as DialogHeader, c as DialogTitle, d as DialogDescription } from "./dialog-C3kXNAKa.js";
|
|
import { I as Input } from "./input-DfkIsvXR.js";
|
|
import { L as Label } from "./label-DrpjkvJN.js";
|
|
import { T as Textarea } from "./textarea-CcuSk8nN.js";
|
|
import FilePondPluginImageExifOrientation from "filepond-plugin-image-exif-orientation";
|
|
import FilePondPluginImagePreview from "filepond-plugin-image-preview";
|
|
/* empty css */
|
|
import { registerPlugin, FilePond } from "react-filepond";
|
|
import { useState, useEffect } from "react";
|
|
import { toast } from "sonner";
|
|
import "@radix-ui/react-slot";
|
|
import "class-variance-authority";
|
|
import "clsx";
|
|
import "tailwind-merge";
|
|
import "@icons-pack/react-simple-icons";
|
|
import "./select-CsRyyQUa.js";
|
|
import "@radix-ui/react-select";
|
|
import "./sheet-Bq2cyJmx.js";
|
|
import "@radix-ui/react-dialog";
|
|
import "@radix-ui/react-label";
|
|
function SwiperCarousel({
|
|
item
|
|
}) {
|
|
const { t } = useTranslations();
|
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
"div",
|
|
{
|
|
className: "relative mx-auto max-w-screen-2xl overflow-clip",
|
|
id: "hero_swiper",
|
|
children: [
|
|
/* @__PURE__ */ jsx(
|
|
Swiper,
|
|
{
|
|
slidesPerView: 1,
|
|
loop: true,
|
|
autoplay: {
|
|
delay: 1500
|
|
},
|
|
className: "w-full",
|
|
navigation: true,
|
|
modules: [Navigation],
|
|
children: item.map((e) => /* @__PURE__ */ jsx(SwiperSlide, { className: "relative !w-full overflow-clip", children: /* @__PURE__ */ jsx(
|
|
"img",
|
|
{
|
|
src: e.image_url,
|
|
alt: e.alt,
|
|
className: "mx-auto aspect-[16/6.5] h-full !w-full max-w-screen-2xl object-cover object-center max-sm:aspect-video"
|
|
}
|
|
) }))
|
|
}
|
|
),
|
|
/* @__PURE__ */ jsxs("div", { className: "absolute bottom-7 left-12 z-50 flex w-md flex-col gap-6 rounded-lg bg-[#FFF5F1]/80 px-12 py-6 font-serif", children: [
|
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
/* @__PURE__ */ jsx("h1", { className: "text-3xl font-medium max-sm:text-lg", children: t("pages.home.banner.title") }),
|
|
/* @__PURE__ */ jsx("p", { className: "text-xl leading-tight max-sm:text-sm", children: t("pages.home.banner.subTitle") })
|
|
] }),
|
|
/* @__PURE__ */ jsx(Link, { href: index.product().url, children: /* @__PURE__ */ jsxs(
|
|
Button,
|
|
{
|
|
variant: "secondary",
|
|
size: "lg",
|
|
className: "cursor-pointer border border-primary bg-transparent text-lg ring-primary",
|
|
children: [
|
|
t("pages.home.banner.button"),
|
|
" ",
|
|
/* @__PURE__ */ jsx(MoveRightIcon, {})
|
|
]
|
|
}
|
|
) })
|
|
] })
|
|
]
|
|
}
|
|
) });
|
|
}
|
|
function Testimonial({
|
|
testimonial
|
|
}) {
|
|
const [file, setFile] = useState(null);
|
|
const [open, setOpen] = useState(false);
|
|
const { data, setData, post, processing, errors } = useForm({
|
|
name: "",
|
|
location: "",
|
|
description: "",
|
|
image: null
|
|
});
|
|
registerPlugin(
|
|
FilePondPluginImageExifOrientation,
|
|
FilePondPluginImagePreview
|
|
);
|
|
useEffect(() => {
|
|
if (file) {
|
|
setData("image", file.file);
|
|
}
|
|
}, [file, setData]);
|
|
const handleSubmit = (e) => {
|
|
e.preventDefault();
|
|
post("/testimonial", {
|
|
// forceFormData: true,
|
|
onSuccess: () => {
|
|
toast.success("Testimonial successfully uploaded!");
|
|
setOpen(false);
|
|
setFile(null);
|
|
setData({
|
|
name: "",
|
|
location: "",
|
|
description: "",
|
|
image: null
|
|
});
|
|
}
|
|
});
|
|
};
|
|
const { t } = useTranslations();
|
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("section", { className: "mx-auto flex max-w-screen-2xl flex-col items-center gap-12 px-16 py-12 max-sm:px-8", children: [
|
|
/* @__PURE__ */ jsx("h4", { className: "text-center font-serif text-4xl font-medium", children: t("pages.home.sections.testimonial.title") }),
|
|
/* @__PURE__ */ jsx(
|
|
"div",
|
|
{
|
|
className: "relative max-w-7xl overflow-clip max-sm:max-w-sm",
|
|
id: "testimonial",
|
|
children: /* @__PURE__ */ jsx(
|
|
Swiper,
|
|
{
|
|
spaceBetween: 16,
|
|
slidesPerView: 4,
|
|
breakpoints: {
|
|
432: {
|
|
slidesPerView: 2,
|
|
spaceBetween: 8
|
|
},
|
|
768: {
|
|
slidesPerView: 3,
|
|
spaceBetween: 8
|
|
},
|
|
1024: {
|
|
slidesPerView: 4,
|
|
spaceBetween: 16
|
|
}
|
|
},
|
|
loop: true,
|
|
autoplay: {
|
|
delay: 1500
|
|
},
|
|
className: "w-full",
|
|
pagination: true,
|
|
modules: [Pagination],
|
|
children: testimonial.map((review) => /* @__PURE__ */ jsx(SwiperSlide, { className: "relative overflow-clip", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-4 rounded-lg border border-gray-300 px-6 py-6 text-center", children: [
|
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
/* @__PURE__ */ jsx(
|
|
"img",
|
|
{
|
|
src: review.image,
|
|
alt: review.name,
|
|
className: "mb-4 aspect-video rounded-md object-cover object-center"
|
|
}
|
|
),
|
|
/* @__PURE__ */ jsx("p", { className: "text-lg font-bold", children: review.name }),
|
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500", children: review.location })
|
|
] }),
|
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-gray-800", children: review.description }),
|
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
/* @__PURE__ */ jsx(Star, { size: 16, color: "#EDC001" }),
|
|
/* @__PURE__ */ jsx(Star, { size: 16, color: "#EDC001" }),
|
|
/* @__PURE__ */ jsx(Star, { size: 16, color: "#EDC001" }),
|
|
/* @__PURE__ */ jsx(Star, { size: 16, color: "#EDC001" }),
|
|
/* @__PURE__ */ jsx(Star, { size: 16, color: "#EDC001" })
|
|
] })
|
|
] }) }))
|
|
}
|
|
)
|
|
}
|
|
),
|
|
/* @__PURE__ */ jsxs(Dialog, { open, onOpenChange: setOpen, children: [
|
|
/* @__PURE__ */ jsx(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { className: "cursor-pointer", children: t("pages.home.sections.testimonial.button") }) }),
|
|
/* @__PURE__ */ jsx(DialogContent, { className: "!max-w-3xl", children: /* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
/* @__PURE__ */ jsx(DialogTitle, { children: "Give your testimonial" }),
|
|
/* @__PURE__ */ jsx(DialogDescription, {}),
|
|
/* @__PURE__ */ jsxs(
|
|
"form",
|
|
{
|
|
className: "grid gap-4",
|
|
onSubmit: handleSubmit,
|
|
method: "POST",
|
|
children: [
|
|
/* @__PURE__ */ jsxs("div", { className: "grid gap-3", children: [
|
|
/* @__PURE__ */ jsx(Label, { htmlFor: "name", children: "Name" }),
|
|
/* @__PURE__ */ jsx(
|
|
Input,
|
|
{
|
|
id: "name",
|
|
name: "name",
|
|
placeholder: "Enter your name",
|
|
value: data.name,
|
|
onChange: (e) => setData("name", e.target.value)
|
|
}
|
|
)
|
|
] }),
|
|
/* @__PURE__ */ jsxs("div", { className: "grid gap-3", children: [
|
|
/* @__PURE__ */ jsx(Label, { htmlFor: "company", children: "Location" }),
|
|
/* @__PURE__ */ jsx(
|
|
Input,
|
|
{
|
|
id: "company",
|
|
name: "location",
|
|
placeholder: "Enter you location (e.g. Private Company / Country Name)",
|
|
value: data.location,
|
|
onChange: (e) => setData("location", e.target.value)
|
|
}
|
|
)
|
|
] }),
|
|
/* @__PURE__ */ jsxs("div", { className: "grid gap-3", children: [
|
|
/* @__PURE__ */ jsx(Label, { htmlFor: "review", children: "Description" }),
|
|
/* @__PURE__ */ jsx(
|
|
Textarea,
|
|
{
|
|
id: "review",
|
|
name: "review",
|
|
cols: 20,
|
|
placeholder: "Write your review...",
|
|
value: data.description,
|
|
onChange: (e) => setData(
|
|
"description",
|
|
e.target.value
|
|
)
|
|
}
|
|
)
|
|
] }),
|
|
/* @__PURE__ */ jsxs("div", { className: "grid gap-3", children: [
|
|
/* @__PURE__ */ jsx(Label, { children: "Image" }),
|
|
/* @__PURE__ */ jsx(
|
|
FilePond,
|
|
{
|
|
files: file ? [file] : [],
|
|
onupdatefiles: (fileItems) => {
|
|
setFile(fileItems[0] || null);
|
|
},
|
|
allowMultiple: false,
|
|
maxFiles: 1,
|
|
name: "image",
|
|
instantUpload: false,
|
|
storeAsFile: true,
|
|
labelIdle: 'Drag & Drop your image or <span class="filepond--label-action">Browse</span>'
|
|
}
|
|
),
|
|
errors.image && /* @__PURE__ */ jsx("span", { className: "text-red-600", children: errors.image })
|
|
] }),
|
|
/* @__PURE__ */ jsx(
|
|
Button,
|
|
{
|
|
type: "submit",
|
|
disabled: processing,
|
|
className: "cursor-pointer",
|
|
children: processing ? "Submitting..." : "Submit Now"
|
|
}
|
|
)
|
|
]
|
|
}
|
|
)
|
|
] }) })
|
|
] })
|
|
] }) });
|
|
}
|
|
const artofWeaving = "/build/assets/IMG_1301-B4CIh8ih.jpg";
|
|
const kaleenCarpet = "/build/assets/IMG_3401-C-Qu3Vp9.jpg";
|
|
const sooryaCarpet = "/build/assets/sci%20trad%2031-B2acD_xa.jpg";
|
|
function Welcome({
|
|
data
|
|
}) {
|
|
const { t } = useTranslations();
|
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
/* @__PURE__ */ jsxs(Head, { title: "Premium Hand Knotted Carpets in Nepal", children: [
|
|
/* @__PURE__ */ jsx("link", { rel: "preconnect", href: "https://fonts.bunny.net" }),
|
|
/* @__PURE__ */ jsx(
|
|
"link",
|
|
{
|
|
href: "https://fonts.bunny.net/css?family=instrument-sans:400,500,600",
|
|
rel: "stylesheet"
|
|
}
|
|
),
|
|
/* @__PURE__ */ jsx(
|
|
"meta",
|
|
{
|
|
name: "description",
|
|
content: "Experience the finest hand-knotted carpets in Nepal with Soorya Carpet. Each piece is crafted by skilled artisans to deliver unmatched quality, luxury, and timeless design."
|
|
}
|
|
)
|
|
] }),
|
|
/* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsxs("div", { children: [
|
|
/* @__PURE__ */ jsx(SwiperCarousel, { item: data?.carousel }),
|
|
/* @__PURE__ */ jsxs("section", { className: "mx-auto grid max-w-screen-2xl grid-cols-2 gap-20 px-16 py-12", children: [
|
|
/* @__PURE__ */ jsx(
|
|
"img",
|
|
{
|
|
src: sooryaCarpet,
|
|
alt: "Soorya Carpet",
|
|
className: "aspect-video rounded-lg object-cover object-center"
|
|
}
|
|
),
|
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
/* @__PURE__ */ jsx("h2", { className: "font-serif text-3xl font-medium", children: t("pages.home.sections.first.title") }),
|
|
/* @__PURE__ */ jsx("p", { className: "text-gray-500", children: t("pages.home.sections.first.desc") })
|
|
] }),
|
|
/* @__PURE__ */ jsx(Link, { href: about(), children: /* @__PURE__ */ jsxs(
|
|
Button,
|
|
{
|
|
variant: "outline",
|
|
className: "w-fit cursor-pointer border border-primary bg-transparent font-serif ring-primary",
|
|
children: [
|
|
t("pages.home.sections.first.button"),
|
|
" ",
|
|
/* @__PURE__ */ jsx(MoveRight, {})
|
|
]
|
|
}
|
|
) })
|
|
] })
|
|
] }),
|
|
/* @__PURE__ */ jsxs("section", { className: "mx-auto grid max-w-screen-2xl grid-cols-2 gap-20 px-16 py-12", children: [
|
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
/* @__PURE__ */ jsx("h3", { className: "font-serif text-3xl font-medium", children: t("pages.home.sections.second.title") }),
|
|
/* @__PURE__ */ jsx("p", { className: "text-gray-500", children: t("pages.home.sections.second.desc") })
|
|
] }),
|
|
/* @__PURE__ */ jsx(Link, { href: about(), children: /* @__PURE__ */ jsxs(
|
|
Button,
|
|
{
|
|
variant: "outline",
|
|
className: "w-fit cursor-pointer border border-primary bg-transparent font-serif ring-primary",
|
|
children: [
|
|
t("pages.home.sections.second.button"),
|
|
/* @__PURE__ */ jsx(MoveRight, {})
|
|
]
|
|
}
|
|
) })
|
|
] }),
|
|
/* @__PURE__ */ jsx(
|
|
"img",
|
|
{
|
|
src: kaleenCarpet,
|
|
alt: "Kaleen Carpet",
|
|
className: "aspect-video rounded-lg object-cover object-center"
|
|
}
|
|
)
|
|
] }),
|
|
/* @__PURE__ */ jsxs("section", { className: "mx-auto grid max-w-screen-2xl grid-cols-2 gap-20 px-16 py-12", children: [
|
|
/* @__PURE__ */ jsx(
|
|
"img",
|
|
{
|
|
src: artofWeaving,
|
|
alt: "Art of Weaving",
|
|
className: "aspect-video rounded-lg object-cover object-center"
|
|
}
|
|
),
|
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
/* @__PURE__ */ jsx("h2", { className: "font-serif text-3xl font-medium", children: t("pages.home.sections.third.title") }),
|
|
/* @__PURE__ */ jsx("p", { className: "text-gray-500", children: t("pages.home.sections.third.desc") })
|
|
] }),
|
|
/* @__PURE__ */ jsx(Link, { href: artOfWeaving(), children: /* @__PURE__ */ jsxs(
|
|
Button,
|
|
{
|
|
variant: "outline",
|
|
className: "w-fit cursor-pointer border border-primary bg-transparent font-serif ring-primary",
|
|
children: [
|
|
t("pages.home.sections.third.button"),
|
|
" ",
|
|
/* @__PURE__ */ jsx(MoveRight, {})
|
|
]
|
|
}
|
|
) })
|
|
] })
|
|
] }),
|
|
/* @__PURE__ */ jsx(Testimonial, { testimonial: data?.testimonial })
|
|
] }) })
|
|
] });
|
|
}
|
|
export {
|
|
Welcome as default
|
|
};
|