From 685c2388f6d9542acf2ff62e1e43c9029919ed02 Mon Sep 17 00:00:00 2001 From: c00b3r Date: Wed, 7 May 2025 19:28:09 +0500 Subject: [PATCH] fix: issue with translate --- client/src/components/MoreProjectButton.tsx | 10 +- client/src/components/VideoSliderMobile.tsx | 88 +-- .../components/modals/CreateProjectModal.tsx | 528 ++++++++-------- .../components/modals/EditProjectModal.tsx | 590 +++++++++--------- client/src/pages/ProjectsPage.tsx | 200 +++--- 5 files changed, 708 insertions(+), 708 deletions(-) diff --git a/client/src/components/MoreProjectButton.tsx b/client/src/components/MoreProjectButton.tsx index 72af7e4..cf9da2e 100644 --- a/client/src/components/MoreProjectButton.tsx +++ b/client/src/components/MoreProjectButton.tsx @@ -1,5 +1,5 @@ -import { motion } from "framer-motion"; -import PlusIcon from "./icons/PlusIcon"; +import { motion } from 'framer-motion'; +import PlusIcon from './icons/PlusIcon'; interface MoreProjectButtonProps { onClick?: () => void; @@ -10,12 +10,12 @@ function MoreProjectButton({ onClick }: MoreProjectButtonProps) { -

Показать еще

+

Show more

); diff --git a/client/src/components/VideoSliderMobile.tsx b/client/src/components/VideoSliderMobile.tsx index 515557f..9c91b8b 100644 --- a/client/src/components/VideoSliderMobile.tsx +++ b/client/src/components/VideoSliderMobile.tsx @@ -1,53 +1,53 @@ /* eslint-disable react-hooks/rules-of-hooks */ /* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { motion } from "framer-motion"; -import { useEffect, useRef, useState } from "react"; -import ArrowLeftIcon from "./icons/ArrowLeftIcon"; -import ArrowRightIcon from "./icons/ArrowRightIcon"; -import { useSwipeable } from "react-swipeable"; +import { motion } from 'framer-motion'; +import { useEffect, useRef, useState } from 'react'; +import ArrowLeftIcon from './icons/ArrowLeftIcon'; +import ArrowRightIcon from './icons/ArrowRightIcon'; +import { useSwipeable } from 'react-swipeable'; function VideoSliderMobile() { const [items] = useState([ { - title: "Virtual tour of the residential complex", - desc: "The client can personally assess the angle of sunlight, minor architectural forms, and landscape, moving through the complex with a tap.", - video: "/videos/features/virtual_tour.mp4", + title: 'Virtual tour of the residential complex', + desc: 'The client can personally assess the angle of sunlight, minor architectural forms, and landscape, moving through the complex with a tap.', + video: '/videos/features/virtual_tour.mp4', }, { - title: "All infrastructure on one screen", - desc: "The ability to assess the infrastructure of the area will show the client important points of interest and the time it takes to reach them.", - video: "/videos/features/nks_infra.mp4", + title: 'All infrastructure on one screen', + desc: 'The ability to assess the infrastructure of the area will show the client important points of interest and the time it takes to reach them.', + video: '/videos/features/nks_infra.mp4', }, { - title: "Конфигуратор интерьера", - desc: "The client can freely choose furniture and design using the interior configurator. It is possible to select the style for the entire apartment or change individual details.", - video: "/videos/features/uralsky.mp4", + title: 'Interior Configurator', + desc: 'The client can freely choose furniture and design using the interior configurator. It is possible to select the style for the entire apartment or change individual details.', + video: '/videos/features/uralsky.mp4', }, { - title: "Parametric apartment search", - desc: "The filter will allow marking specific advantages, determine the number of rooms, desired floor, price, and receive a selection of suitable options.", - video: "/videos/features/parametric.mp4", + title: 'Parametric apartment search', + desc: 'The filter will allow marking specific advantages, determine the number of rooms, desired floor, price, and receive a selection of suitable options.', + video: '/videos/features/parametric.mp4', }, { - title: "Any render in a few seconds", - desc: "When you need any object from any angle for advertising, just take a picture inside the presentation.", - video: "/videos/features/render.mp4", + title: 'Any render in a few seconds', + desc: 'When you need any object from any angle for advertising, just take a picture inside the presentation.', + video: '/videos/features/render.mp4', }, { - title: "Formation of a wishlist", - desc: "The client can add apartment options to favorites, compare them with each other by the main parameters, and choose their future apartment.", - video: "/videos/features/wish.mp4", + title: 'Formation of a wishlist', + desc: 'The client can add apartment options to favorites, compare them with each other by the main parameters, and choose their future apartment.', + video: '/videos/features/wish.mp4', }, { - title: "Integration with CRM", + title: 'Integration with CRM', desc: "The application transfers client information to the developer's CRM system and receives current information about prices and statuses of apartments.", - video: "/videos/features/integra_crm.mp4", + video: '/videos/features/integra_crm.mp4', }, { - title: "Sending a commercial offer", - desc: "A commercial offer with selected apartments can be sent to the client by mail or printed and handed over personally.", - video: "/videos/features/send.mp4", + title: 'Sending a commercial offer', + desc: 'A commercial offer with selected apartments can be sent to the client by mail or printed and handed over personally.', + video: '/videos/features/send.mp4', }, // { // title: "Интерактивная инсоляция", @@ -65,11 +65,11 @@ function VideoSliderMobile() { const videoRefs = items.map(() => useRef(null)); const handlers = useSwipeable({ onSwiped: (e) => { - if (e.dir === "Left") { + if (e.dir === 'Left') { handleClickNext(); } - if (e.dir === "Right") { + if (e.dir === 'Right') { handleClickPrev(); } }, @@ -106,7 +106,7 @@ function VideoSliderMobile() { return (
))}
-
-
-

+

+
+

{items[activeIndex].title}

-

{items[activeIndex].desc}

+

{items[activeIndex].desc}

-
-
-

+

+
+

{activeIndex + 1}/{items.length}

-
+
diff --git a/client/src/components/modals/CreateProjectModal.tsx b/client/src/components/modals/CreateProjectModal.tsx index 7eac0ee..41f0477 100644 --- a/client/src/components/modals/CreateProjectModal.tsx +++ b/client/src/components/modals/CreateProjectModal.tsx @@ -1,292 +1,292 @@ -/* eslint-disable react-hooks/exhaustive-deps */ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import { ChangeEvent, useEffect, useState } from 'react'; -import api from '../../utils/api'; -import Button from '../Button'; -import IProject from '../../types/IProject'; -import useModalStore from '../../stores/useModalStore'; -import { format } from 'date-fns'; -import Close2Icon from '../icons/Close2Icon'; +// /* eslint-disable react-hooks/exhaustive-deps */ +// /* eslint-disable @typescript-eslint/no-explicit-any */ +// import { ChangeEvent, useEffect, useState } from 'react'; +// import api from '../../utils/api'; +// import Button from '../Button'; +// import IProject from '../../types/IProject'; +// import useModalStore from '../../stores/useModalStore'; +// import { format } from 'date-fns'; +// import Close2Icon from '../icons/Close2Icon'; -function CreateProjectModal() { - const [project, setProject] = useState({ - title: '', - company: '', - city: '', - image: '', - releaseDate: format(new Date(), 'yyyy-MM-dd'), - devices: [], - }); +// function CreateProjectModal() { +// const [project, setProject] = useState({ +// title: '', +// company: '', +// city: '', +// image: '', +// releaseDate: format(new Date(), 'yyyy-MM-dd'), +// devices: [], +// }); - const [file, setFile] = useState(); - const [previewFile, setPreviewFile] = useState(); - const [setModal] = useModalStore((state) => [state.setModal]); +// const [file, setFile] = useState(); +// const [previewFile, setPreviewFile] = useState(); +// const [setModal] = useModalStore((state) => [state.setModal]); - function handleChangeFile(e: ChangeEvent) { - if (!e.target.files) return; +// function handleChangeFile(e: ChangeEvent) { +// if (!e.target.files) return; - const targetFile = e.target.files[0]; +// const targetFile = e.target.files[0]; - setFile(targetFile); - setPreviewFile(URL.createObjectURL(targetFile)); - } +// setFile(targetFile); +// setPreviewFile(URL.createObjectURL(targetFile)); +// } - async function uploadFile() { - if (!file) return; +// async function uploadFile() { +// if (!file) return; - const formData = new FormData(); - formData.append('file', file); +// const formData = new FormData(); +// formData.append('file', file); - try { - const { file }: { file: string } = await api - .post('upload', { body: formData }) - .json(); +// try { +// const { file }: { file: string } = await api +// .post('upload', { body: formData }) +// .json(); - setProject((prev) => ({ - ...prev, - image: file, - })); - } catch (error) { - if (error instanceof Error) { - alert(`Error: ${error.message}`); - } - } - } +// setProject((prev) => ({ +// ...prev, +// image: file, +// })); +// } catch (error) { +// if (error instanceof Error) { +// alert(`Error: ${error.message}`); +// } +// } +// } - async function createProject() { - try { - await api.post('projects', { json: { ...project } }); +// async function createProject() { +// try { +// await api.post('projects', { json: { ...project } }); - setModal(null); - } catch (error) { - if (error instanceof Error) { - alert(`Error: ${error.message}`); - } - } - } +// setModal(null); +// } catch (error) { +// if (error instanceof Error) { +// alert(`Error: ${error.message}`); +// } +// } +// } - async function handleSubmit(e: ChangeEvent) { - e.preventDefault(); +// async function handleSubmit(e: ChangeEvent) { +// e.preventDefault(); - await createProject(); +// await createProject(); - window.location.reload(); - } +// window.location.reload(); +// } - useEffect(() => { - uploadFile(); - }, [file]); +// useEffect(() => { +// uploadFile(); +// }, [file]); - return ( -
-
-

Создание проекта

- -
-
-
- - - setProject((prev) => ({ ...prev, title: e.target.value })) - } - /> -
+// return ( +//
+//
+//

Создание проекта

+// +//
+// +//
+// +// +// setProject((prev) => ({ ...prev, title: e.target.value })) +// } +// /> +//
-
- - - setProject((prev) => ({ ...prev, company: e.target.value })) - } - /> -
+//
+// +// +// setProject((prev) => ({ ...prev, company: e.target.value })) +// } +// /> +//
-
- - - setProject((prev) => ({ ...prev, city: e.target.value })) - } - /> -
+//
+// +// +// setProject((prev) => ({ ...prev, city: e.target.value })) +// } +// /> +//
- -
- - -
+//
+// +// +//
-
- - - setProject((prev) => ({ - ...prev, - releaseDate: e.target.value, - })) - } - className='border border-neutral-500 px-3 py-2 rounded-lg outline-none' - /> -
+//
+// +// +// setProject((prev) => ({ +// ...prev, +// releaseDate: e.target.value, +// })) +// } +// className='px-3 py-2 border rounded-lg outline-none border-neutral-500' +// /> +//
-
-

Девайсы

-
- +//
+//

Девайсы

+//
+// - +// - +// - -
-
+// +//
+//
-
- -
- -
- ); -} +//
+// +//
+// +//
+// ); +// } -export default CreateProjectModal; +// export default CreateProjectModal; diff --git a/client/src/components/modals/EditProjectModal.tsx b/client/src/components/modals/EditProjectModal.tsx index b400107..c654aac 100644 --- a/client/src/components/modals/EditProjectModal.tsx +++ b/client/src/components/modals/EditProjectModal.tsx @@ -1,325 +1,325 @@ -/* eslint-disable react-hooks/exhaustive-deps */ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import { ChangeEvent, useEffect, useState } from 'react'; -import api from '../../utils/api'; -import Button from '../Button'; -import IProject from '../../types/IProject'; -import useModalStore from '../../stores/useModalStore'; -import { format, parseISO } from 'date-fns'; -import Close2Icon from '../icons/Close2Icon'; +// /* eslint-disable react-hooks/exhaustive-deps */ +// /* eslint-disable @typescript-eslint/no-explicit-any */ +// import { ChangeEvent, useEffect, useState } from 'react'; +// import api from '../../utils/api'; +// import Button from '../Button'; +// import IProject from '../../types/IProject'; +// import useModalStore from '../../stores/useModalStore'; +// import { format, parseISO } from 'date-fns'; +// import Close2Icon from '../icons/Close2Icon'; -interface EditProjectModalProps { - projectId: string; -} +// interface EditProjectModalProps { +// projectId: string; +// } -function EditProjectModal({ projectId }: EditProjectModalProps) { - const [project, setProject] = useState({ - title: '', - company: '', - city: '', - image: '', - releaseDate: '2023-01-01', - devices: [], - }); +// function EditProjectModal({ projectId }: EditProjectModalProps) { +// const [project, setProject] = useState({ +// title: '', +// company: '', +// city: '', +// image: '', +// releaseDate: '2023-01-01', +// devices: [], +// }); - const [file, setFile] = useState(); - const [previewFile, setPreviewFile] = useState(); - const [setModal] = useModalStore((state) => [state.setModal]); +// const [file, setFile] = useState(); +// const [previewFile, setPreviewFile] = useState(); +// const [setModal] = useModalStore((state) => [state.setModal]); - function handleChangeFile(e: ChangeEvent) { - if (!e.target.files) return; +// function handleChangeFile(e: ChangeEvent) { +// if (!e.target.files) return; - const targetFile = e.target.files[0]; +// const targetFile = e.target.files[0]; - setFile(targetFile); - setPreviewFile(URL.createObjectURL(targetFile)); - } +// setFile(targetFile); +// setPreviewFile(URL.createObjectURL(targetFile)); +// } - async function uploadFile() { - if (!file) return; +// async function uploadFile() { +// if (!file) return; - const formData = new FormData(); - formData.append('file', file); +// const formData = new FormData(); +// formData.append('file', file); - try { - const { file }: { file: string } = await api - .post('upload', { body: formData }) - .json(); +// try { +// const { file }: { file: string } = await api +// .post('upload', { body: formData }) +// .json(); - setProject((prev) => ({ - ...prev, - image: file, - })); - } catch (error) { - if (error instanceof Error) { - alert(`Error: ${error.message}`); - } - } - } +// setProject((prev) => ({ +// ...prev, +// image: file, +// })); +// } catch (error) { +// if (error instanceof Error) { +// alert(`Error: ${error.message}`); +// } +// } +// } - async function updateProject() { - try { - await api.put(`projects/${projectId}`, { json: { ...project } }); - } catch (error) { - if (error instanceof Error) { - alert(`Error: ${error.message}`); - } - } - } +// async function updateProject() { +// try { +// await api.put(`projects/${projectId}`, { json: { ...project } }); +// } catch (error) { +// if (error instanceof Error) { +// alert(`Error: ${error.message}`); +// } +// } +// } - async function handleSubmit(e: ChangeEvent) { - e.preventDefault(); +// async function handleSubmit(e: ChangeEvent) { +// e.preventDefault(); - await updateProject(); - setModal(null); - window.location.reload(); - } +// await updateProject(); +// setModal(null); +// window.location.reload(); +// } - async function getProject() { - try { - const project: IProject = await api.get(`projects/${projectId}`).json(); - project.releaseDate = format(parseISO(project.releaseDate), 'yyyy-MM-dd'); +// async function getProject() { +// try { +// const project: IProject = await api.get(`projects/${projectId}`).json(); +// project.releaseDate = format(parseISO(project.releaseDate), 'yyyy-MM-dd'); - setProject(project); - } catch (error) { - if (error instanceof Error) { - alert(`Error: ${error.message}`); - } - } - } +// setProject(project); +// } catch (error) { +// if (error instanceof Error) { +// alert(`Error: ${error.message}`); +// } +// } +// } - useEffect(() => { - uploadFile(); - }, [file]); +// useEffect(() => { +// uploadFile(); +// }, [file]); - useEffect(() => { - getProject(); - }, []); +// useEffect(() => { +// getProject(); +// }, []); - return ( -
-
-

Редактирование проекта

- -
-
-
- - - setProject((prev) => ({ ...prev, title: e.target.value })) - } - /> -
+// return ( +//
+//
+//

Редактирование проекта

+// +//
+// +//
+// +// +// setProject((prev) => ({ ...prev, title: e.target.value })) +// } +// /> +//
-
- - - setProject((prev) => ({ ...prev, company: e.target.value })) - } - /> -
+//
+// +// +// setProject((prev) => ({ ...prev, company: e.target.value })) +// } +// /> +//
-
- - - setProject((prev) => ({ ...prev, city: e.target.value })) - } - /> -
+//
+// +// +// setProject((prev) => ({ ...prev, city: e.target.value })) +// } +// /> +//
- -
- - -
+//
+// +// +//
-
- - - setProject((prev) => ({ - ...prev, - releaseDate: e.target.value, - })) - } - className='border border-neutral-500 px-3 py-2 rounded-lg outline-none' - /> -
+//
+// +// +// setProject((prev) => ({ +// ...prev, +// releaseDate: e.target.value, +// })) +// } +// className='px-3 py-2 border rounded-lg outline-none border-neutral-500' +// /> +//
-
-

Девайсы

-
- +//
+//

Девайсы

+//
+// - +// - +// - -
-
+// +//
+//
-
- -
- -
- ); -} +//
+// +//
+// +//
+// ); +// } -export default EditProjectModal; +// export default EditProjectModal; diff --git a/client/src/pages/ProjectsPage.tsx b/client/src/pages/ProjectsPage.tsx index f26f7f4..ad21083 100644 --- a/client/src/pages/ProjectsPage.tsx +++ b/client/src/pages/ProjectsPage.tsx @@ -1,108 +1,108 @@ -import { useEffect, useState } from "react"; -import api from "../utils/api"; -import IProject from "../types/IProject"; -import ProjectCard from "../components/ProjectCard"; -import Button from "../components/Button"; -import useModalStore from "../stores/useModalStore"; -import CreateProjectModal from "../components/modals/CreateProjectModal"; -import ModalContainer from "../components/ModalContainer"; -import EditProjectModal from "../components/modals/EditProjectModal"; -import DeleteProjectModal from "../components/modals/DeleteProjectModal"; +// import { useEffect, useState } from "react"; +// import api from "../utils/api"; +// import IProject from "../types/IProject"; +// import ProjectCard from "../components/ProjectCard"; +// import Button from "../components/Button"; +// import useModalStore from "../stores/useModalStore"; +// import CreateProjectModal from "../components/modals/CreateProjectModal"; +// import ModalContainer from "../components/ModalContainer"; +// import EditProjectModal from "../components/modals/EditProjectModal"; +// import DeleteProjectModal from "../components/modals/DeleteProjectModal"; -function ProjectsPage() { - const [projects, setProjects] = useState([]); - const [setModal] = useModalStore((state) => [state.setModal]); +// function ProjectsPage() { +// const [projects, setProjects] = useState([]); +// const [setModal] = useModalStore((state) => [state.setModal]); - async function getProjects() { - try { - const projects: IProject[] = await api.get("projects").json(); +// async function getProjects() { +// try { +// const projects: IProject[] = await api.get("projects").json(); - setProjects(projects); - } catch (error) { - if (error instanceof Error) { - alert(`Error: ${error.message}`); - } - } - } +// setProjects(projects); +// } catch (error) { +// if (error instanceof Error) { +// alert(`Error: ${error.message}`); +// } +// } +// } - function handleClickCreateProject() { - setModal(); - } +// function handleClickCreateProject() { +// setModal(); +// } - useEffect(() => { - getProjects(); - }, []); +// useEffect(() => { +// getProjects(); +// }, []); - return ( -
-
- -
-
-
-
- {projects.map((project, index) => ( -
- -
- - -
-
- ))} -
-
-
+// return ( +//
+//
+// +//
+//
+//
+//
+// {projects.map((project, index) => ( +//
+// +//
+// +// +//
+//
+// ))} +//
+//
+//
- -
- ); -} +// +//
+// ); +// } -export default ProjectsPage; +// export default ProjectsPage;