From 27a65231945a76a84ce399de4889c466ff3d44bf Mon Sep 17 00:00:00 2001 From: Batyr Date: Sat, 31 May 2025 13:33:10 +0500 Subject: [PATCH] change --- .../shared/impressions/designers.tsx | 21 +++++++++++---- src/components/shared/impressions/hero.tsx | 26 ++++++++++++++++--- src/components/shared/impressions/videos.tsx | 10 +++++-- src/locales/en/main.json | 17 +++++++++--- src/locales/ru/main.json | 16 +++++++++--- src/main.tsx | 6 +++++ src/pages/impressions-tm.tsx | 14 ++++++++++ src/pages/index.ts | 1 + 8 files changed, 92 insertions(+), 19 deletions(-) create mode 100644 src/pages/impressions-tm.tsx diff --git a/src/components/shared/impressions/designers.tsx b/src/components/shared/impressions/designers.tsx index 2173519..db5f61f 100644 --- a/src/components/shared/impressions/designers.tsx +++ b/src/components/shared/impressions/designers.tsx @@ -6,8 +6,15 @@ import { useTranslation } from "react-i18next"; import { useCallback, useEffect, useState } from "react"; import { ChevronLeft, ChevronRight } from "lucide-react"; import { cn } from "@/lib/utils"; +import { useLocation } from "react-router-dom"; const Designers = () => { + const { pathname } = useLocation(); + + const filter = () => (pathname !== "/impressions" ? true : false); + + const { data, isPending } = useDesigners(filter() ? 2 : 1); + const [emblaRef, emblaApi] = useEmblaCarousel({ align: "center", skipSnaps: true, @@ -44,20 +51,24 @@ const Designers = () => { }; }, [emblaApi]); - const { title, text } = t("impressions.designers", { + const { title, text, title2, text2 } = t("impressions.designers", { returnObjects: true, }) as { title: string; + title2: string; text: string; + text2: string; }; - const { data, isPending } = useDesigners(1); - return (
-

{title}

-

{text}

+

+ {filter() ? title : title2} +

+

+ {filter() ? text : text2} +

diff --git a/src/components/shared/impressions/hero.tsx b/src/components/shared/impressions/hero.tsx index 24c256d..01a580c 100644 --- a/src/components/shared/impressions/hero.tsx +++ b/src/components/shared/impressions/hero.tsx @@ -2,16 +2,34 @@ import { Container } from "@/components/layout"; import { Button } from "@/components/ui/button"; import { useLangStore } from "@/store/lang"; import { useTranslation } from "react-i18next"; -import { Link } from "react-router-dom"; +import { Link, useLocation } from "react-router-dom"; const Hero = () => { const { t } = useTranslation("main"); const lang = useLangStore((state) => state.lang); + const { pathname } = useLocation(); const { title, texts, button, button2 } = t("impressions.hero", { returnObjects: true, }) as { title: string; texts: string[]; button: string; button2: string }; + const { title2, texts2 } = t("impressions.hero", { + returnObjects: true, + }) as { + title2: string; + texts2: string[]; + }; + + const filterText = (value: any, value2: string) => { + if (pathname === "/impressions") return value; + else return value2; + }; + + const filterTextArr = (value: string[], value2: string[]) => { + if (pathname === "/impressions") return value; + else return value2; + }; + return (
{ alt="" className="w-full object-cover object-top max-h-[610px]" /> -

Показы

+

Модные показы

- {title} + {filterText(title, title2)}

- {texts.map((item, i) => ( + {filterTextArr(texts, texts2)?.map((item, i) => (

{item}

diff --git a/src/components/shared/impressions/videos.tsx b/src/components/shared/impressions/videos.tsx index 2302d96..d891d85 100644 --- a/src/components/shared/impressions/videos.tsx +++ b/src/components/shared/impressions/videos.tsx @@ -1,16 +1,22 @@ import { Container } from "@/components/layout"; import { useTranslation } from "react-i18next"; +import { useLocation } from "react-router-dom"; const Videos = () => { const { t } = useTranslation("main"); + const { pathname } = useLocation(); - const title = t("impressions.videosTitle"); + const { videosTitle, videosTitle2 } = t("impressions", { + returnObjects: true, + }) as { videosTitle: string; videosTitle2: string }; + + const filter = () => (pathname !== "/impressions" ? true : false); return (

- {title} + {filter() ? videosTitle : videosTitle2}

diff --git a/src/locales/en/main.json b/src/locales/en/main.json index 028d47a..e8b54d2 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -8,12 +8,21 @@ "Don’t miss the chance to be part of this grand event! Join us from June 11 to 13 at the Chamber of Commerce and Industry of Turkmenistan, Ashgabat." ], "button": "Add to calendar", - "button2": "Download program" + "button2": "Download program", + "title2": "TurkmenTextile Expo-2025 – A Crossroads of Style on the Silk Road!", + "texts2": [ + "TurkmenTextile Expo-2025 invites you on a fascinating journey where centuries-old traditions, the latest trends, and the boundless talent of designers from around the world. A true harmony of inspiration and craftsmanship.", + "Don’t miss the opportunity to be part of this grand event! Join us from June 11th to 13th at the Chamber of Commerce and Industry of Turkmenistan, Ashgabat." + ] }, "designers": { - "title": "Meet the Masters of Fashion: TurkmenTextile Expo-2025 Showcases World-Renowned Designers", - "text": "TurkmenTextile Expo-2025 is proud to welcome internationally acclaimed designers to its prestigious platform. Their presence brings not only the latest trends and innovative approaches but also a unique vision of the future of the fashion industry. We are delighted to present the works and profiles of these outstanding creatives, whose participation makes TurkmenTextile Expo-2025 a truly landmark event in the global fashion scene." + "title": "Meet the Masters of Style: Celebrating Turkmen Designers at TurkmenTextile Expo-2025!", + "text": "We are proud to present talented designers from Turkmenistan, whose ambitious collections stand out for their exceptional craftsmanship, impeccable tailoring, and attention to details. Their bold vision of the future, organically intertwined with a rich cultural heritage, creates unique works ready to conquer the widest audience and demonstrate the world-class skill of Turkmen fashion designers.", + + "title2": "Meet the Masters of Fashion: TurkmenTextile Expo-2025 Showcases World-Renowned Designers", + "text2": "TurkmenTextile Expo-2025 is proud to welcome internationally acclaimed designers to its prestigious platform. Their presence brings not only the latest trends and innovative approaches but also a unique vision of the future of the fashion industry. We are delighted to present the works and profiles of these outstanding creatives, whose participation makes TurkmenTextile Expo-2025 a truly landmark event in the global fashion scene." }, - "videosTitle": "“The Elite of Global Fashion: Exclusive Collections by International Designers at TurkmenTextileExpo-2025”" + "videosTitle": "Immerse Yourself in the Designers’ Triumph on the TurkmenTextile Expo-2025 Runway", + "videosTitle2": "“The Elite of Global Fash ion: Exclusive Collections by International Designers at TurkmenTextileExpo-2025”" } } diff --git a/src/locales/ru/main.json b/src/locales/ru/main.json index a04a268..1dc78cf 100644 --- a/src/locales/ru/main.json +++ b/src/locales/ru/main.json @@ -8,12 +8,20 @@ "Не упустите возможность стать частью этого грандиозного события! Присоединяйтесь к нам с 11 по 13 июня в Торгово-Промышленной Палате Туркменистана, Ашхабад." ], "button": "Добавить в календарь (.ics файл)", - "button2": "Скачать программу" + "button2": "Скачать программу", + "title2": "Глобальная мода в сердце Туркменистана: мировые звезды TurkmenTextile Expo-2025!", + "texts2": [ + "Соединяя ведущие модные столицы мира с гостеприимным сердцем Туркменистана, TurkmenTextile Expo-2025 распахнула свои двери, приветствуяистинных звёзд fashion-индустрии. Их участие обогащает туркменскую землю палитрой интернациональных стилей, инновационнымидизайнерскими решениями и свежими взглядами на развитие текстильной и модной промышленности. Приглашаем вас стать свидетелями уникального диалога культур и тенденций, где глобальные тренды находят своё яркое отражение в самом центре Великого Шелкового пути. Не упустите уникальную возможность! Приглашаем вас с 11 по 13 июня в Торгово-Промышленную Палату Туркменистана в Ашхабаде, чтобы стать частью этого грандиозного события." + ] }, "designers": { - "title": "Знакомство с мастерами моды: TurkmenTextile Expo-2025 представляет мировых дизайнеров!", - "text": "Международная выставка TurkmenTextile Expo-2025 с особой гордостью приветствует на своей площадке именитых дизайнеров с мировым именем. Их участие привносит в мероприятие не только свежие тенденции и инновационные подходы, но и уникальное видение будущего модной индустрии. Мы с удовольствием представляем вашему вниманию работы и портреты этих выдающихся дизайнеров, чье присутствие делает TurkmenTextile Expo-2025 по-настоящему знаковым событием в мире моды." + "title": "Познакомьтесь с мастерами стиля: известные дизайнеры на TurkmenTextile Expo-2025!!", + "text": "С гордостью представляем талантливых дизайнеров из Туркменистана, чьи амбициозные проекты отличаются высочайшим качеством исполнения. Аккуратность пошива и идеально точный крой — это лишь часть того, чтоделает их коллекции по-настоящему выдающимися. Их смелый взгляд на будущее, органично переплетенный с богатым культурным наследием, создает уникальные произведения, готовые покорить самую широкую аудиторию и продемонстрировать мировой уровень мастерства туркменских модельеров.", + + "title2": "Знакомство с мастерами моды: TurkmenTextile Expo-2025 представляет мировых дизайнеров!", + "text2": "Международная выставка TurkmenTextile Expo-2025 с особой гордостью приветствует на своей площадке именитых дизайнеров с мировым именем. Их участие привносит в мероприятие не только свежие тенденции и инновационные подходы, но и уникальное видение будущего модной индустрии. Мы с удовольствием представляем вашему вниманию работы и портреты этих выдающихся дизайнеров, чье присутствие делает TurkmenTextile Expo-2025 по-настоящему знаковым событием в мире моды." }, - "videosTitle": "Элита мировой моды: эксклюзивные коллекции международных дизайнеров на TurkmenTextile Expo-2025" + "videosTitle": "Погрузитесь в триумф дизайнеров на подиуме TurkmenTextile Expo- 2025", + "videosTitle2": "Элита мировой моды: эксклюзивные коллекции международных дизайнеров на TurkmenTextile Expo-2025" } } diff --git a/src/main.tsx b/src/main.tsx index b9d18ab..7b03f39 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -11,6 +11,7 @@ import { Contacts, Home, Impressions, + ImpressionsTm, Media, News, NewsInner, @@ -47,6 +48,11 @@ const router = createBrowserRouter([ path: "impressions", errorElement: , }, + { + element: , + path: "impressions-tm", + errorElement: , + }, ], }, ]); diff --git a/src/pages/impressions-tm.tsx b/src/pages/impressions-tm.tsx new file mode 100644 index 0000000..b36eaa9 --- /dev/null +++ b/src/pages/impressions-tm.tsx @@ -0,0 +1,14 @@ +import { Designers, Hero, Videos } from "@/components/shared/impressions"; +import { useScrollTop } from "@/hooks/use-scroll-top"; + +export default function Impressions() { + useScrollTop(); + + return ( +
+ + + +
+ ); +} diff --git a/src/pages/index.ts b/src/pages/index.ts index ba3510d..250f7dc 100644 --- a/src/pages/index.ts +++ b/src/pages/index.ts @@ -9,3 +9,4 @@ export { default as News } from "./news"; export { default as Participants } from "./participants"; export { default as StendForm } from "./stend-form"; export { default as Impressions } from "./impressions"; +export { default as ImpressionsTm } from "./impressions-tm";