{subtitle}
diff --git a/src/components/shared/forms/contacts-form.tsx b/src/components/shared/forms/contacts-form.tsx
new file mode 100644
index 0000000..149fcfd
--- /dev/null
+++ b/src/components/shared/forms/contacts-form.tsx
@@ -0,0 +1,105 @@
+import { FC, useState } from "react";
+import { useForm } from "react-hook-form";
+import { zodResolver } from "@hookform/resolvers/zod";
+import { cn } from "@/lib/utils";
+import { Form } from "@/components/ui/form";
+import { Field } from "../field";
+import { Button } from "@/components/ui/button";
+import {
+ ContactsFormType,
+ contactsSchema,
+ defaultValuesContacts,
+} from "@/lib/get-contacts-form-details";
+import { postContact } from "@/services/service";
+import { FormSuccesStatus } from "../form-succes-status";
+import { Loader2 } from "lucide-react";
+
+interface Props {
+ className?: string;
+}
+
+export const ContactsForm: FC
= ({ className }) => {
+ const [success, setSuccess] = useState(false);
+ const form = useForm({
+ resolver: zodResolver(contactsSchema),
+ defaultValues: defaultValuesContacts,
+ });
+
+ async function onSubmit(data: ContactsFormType) {
+ try {
+ const status = await postContact(data);
+
+ setSuccess(status);
+ } catch (error) {
+ console.error("POST contact", error);
+ }
+ }
+
+ const { errors } = form.formState;
+
+ return (
+
+ );
+};
diff --git a/src/components/shared/home/home-time.tsx b/src/components/shared/home/home-time.tsx
index 453e96f..0bb048d 100644
--- a/src/components/shared/home/home-time.tsx
+++ b/src/components/shared/home/home-time.tsx
@@ -46,7 +46,7 @@ export const HomeTime: FC = ({ className }) => {
return (
- Время мероприятий
+ Время выставки
diff --git a/src/lib/get-contacts-form-details.ts b/src/lib/get-contacts-form-details.ts
new file mode 100644
index 0000000..9a271ce
--- /dev/null
+++ b/src/lib/get-contacts-form-details.ts
@@ -0,0 +1,19 @@
+import { z } from "zod";
+
+export type ContactsFormType = z.infer
;
+
+export const contactsSchema = z.object({
+ name: z.string().min(2, "error"),
+ email: z.string().email(),
+ phone: z.string().min(8, "error"),
+ company: z.string().min(2, "error"),
+ msg: z.string().min(5, "error"),
+});
+
+export const defaultValuesContacts = {
+ name: "",
+ email: "",
+ phone: "",
+ company: "",
+ msg: "",
+};
diff --git a/src/main.tsx b/src/main.tsx
index 2421c3b..4d99784 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -3,7 +3,7 @@ import { createRoot } from "react-dom/client";
import "./index.css";
import App from "./App.tsx";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
-import { About, B2b, BecomeSponsor, Home, StendForm } from "./pages";
+import { About, B2b, BecomeSponsor, Contacts, Home, StendForm } from "./pages";
const router = createBrowserRouter([
{
@@ -30,6 +30,10 @@ const router = createBrowserRouter([
element: ,
path: "/stend-form",
},
+ {
+ element: ,
+ path: "/contacts",
+ },
],
},
]);
diff --git a/src/pages/contacts.tsx b/src/pages/contacts.tsx
new file mode 100644
index 0000000..86541c4
--- /dev/null
+++ b/src/pages/contacts.tsx
@@ -0,0 +1,77 @@
+import { Container } from "@/components/layout";
+import { ContactsForm } from "@/components/shared/forms/contacts-form";
+import { useScrollTop } from "@/hooks/use-scroll-top";
+import { FC } from "react";
+
+interface Props {
+ className?: string;
+}
+
+export const Contacts: FC = () => {
+ useScrollTop();
+
+ return (
+
+
+
+
+
+
+
Контакты
+
+
+
+

+
+
+
Адрес офиса:
+
+ 744000, г. Ашхабад, просп. Битарап Туркменистан, 183
+
+
+
+
+

+
+
+
Телефон:
+
+ +99371871812; 99363719588
+
+
+
+
+
+

+
+
+
Факс:
+ +99312454111
+
+
+
+
+

+
+
+
E-mail:
+ contact@turkmenexpo.com
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/src/pages/index.ts b/src/pages/index.ts
index 50e88e7..9236cc9 100644
--- a/src/pages/index.ts
+++ b/src/pages/index.ts
@@ -3,3 +3,4 @@ export { Home } from "./home";
export { About } from "./about";
export { BecomeSponsor } from "./become-sponsor";
export { StendForm } from "./stend-form";
+export { Contacts } from "./contacts";
diff --git a/src/services/service.ts b/src/services/service.ts
index 609fb2b..f791822 100644
--- a/src/services/service.ts
+++ b/src/services/service.ts
@@ -1,8 +1,9 @@
+import { ContactsFormType } from "@/lib/get-contacts-form-details";
import { SponsorFormType } from "@/lib/get-sponsor-form-details";
import { StandFormType } from "@/lib/get-stend-form-details";
import axios from "axios";
-const URL = "https://itse.turkmenexpo.com/app/api/v1";
+const URL = "https://turkmentextile.turkmenexpo.com/app/api/v1";
export const postStend = async (data: StandFormType): Promise => {
const res = axios.post(`${URL}/book_stand_form`, data);
@@ -22,8 +23,8 @@ export const postSponsor = async (data: SponsorFormType): Promise => {
return (await res).status === 201;
};
-// export const postContact = async (data: ContactsFormType): Promise => {
-// const res = axios.post(`${URL}/contact_form`, data);
+export const postContact = async (data: ContactsFormType): Promise => {
+ const res = axios.post(`${URL}/contact_form`, data);
-// return (await res).status === 201;
-// };
+ return (await res).status === 201;
+};
diff --git a/tailwind.config.js b/tailwind.config.js
index 85eaeb1..5a5e1fa 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -15,10 +15,10 @@ export default {
primary_03: "#F6B2B8",
primary_04: "#9AB4E4",
primary_09: "#99101D",
+ primary_outline_reverse: "#EE6572",
on_primary: "#ffffff",
primary_container: "#F6B2B8",
on_primary_container: "#112343",
- primary_outline_reverse: "#789BDB",
surface_container: "#F0EFEF",