diff --git a/src/app/layout.jsx b/components/RootData/page.jsx similarity index 96% rename from src/app/layout.jsx rename to components/RootData/page.jsx index 5d29a62..756ba33 100644 --- a/src/app/layout.jsx +++ b/components/RootData/page.jsx @@ -1,5 +1,5 @@ "use client"; - +import React from "react"; import "../../style/globals.css"; import { Inter } from "next/font/google"; import "../../style/fontiran.css"; @@ -25,12 +25,7 @@ import moment from "jalali-moment"; const inter = Inter({ subsets: ["latin"] }); -// export const metadata = { -// title: "Create Next App", -// description: "Generated by create next app", -// }; - -export default function RootLayout({ children }) { +const RootData = ({ children }) => { // BottomSheet const [BottomSheetCreateRoleOpen, setBottomSheetCreateRoleOpen] = useState(false); @@ -1589,27 +1584,27 @@ export default function RootLayout({ children }) { useEffect(() => { console.log(` - bbbbbbbb - b::::::b iiii - b::::::b i::::i - b::::::b iiii - b:::::b - b:::::bbbbbbbbb rrrrr rrrrrrrrr iiiiiiizzzzzzzzzzzzzzzzz cccccccccccccccc ooooooooooo - b::::::::::::::bb r::::rrr:::::::::ri:::::iz:::::::::::::::z cc:::::::::::::::coo:::::::::::oo - b::::::::::::::::br:::::::::::::::::ri::::iz::::::::::::::z c:::::::::::::::::o:::::::::::::::o - b:::::bbbbb:::::::rr::::::rrrrr::::::i::::izzzzzzzz::::::z c:::::::cccccc:::::o:::::ooooo:::::o - b:::::b b::::::br:::::r r:::::i::::i z::::::z c::::::c cccccco::::o o::::o - b:::::b b:::::br:::::r rrrrrri::::i z::::::z c:::::c o::::o o::::o - b:::::b b:::::br:::::r i::::i z::::::z c:::::c o::::o o::::o - b:::::b b:::::br:::::r i::::i z::::::z c::::::c cccccco::::o o::::o - b:::::bbbbbb::::::br:::::r i::::::i z::::::zzzzzzzc:::::::cccccc:::::o:::::ooooo:::::o - b::::::::::::::::b r:::::r i::::::iz::::::::::::::zc:::::::::::::::::o:::::::::::::::o - b:::::::::::::::b r:::::r i::::::z:::::::::::::::z cc:::::::::::::::coo:::::::::::oo - bbbbbbbbbbbbbbbb rrrrrrr iiiiiiizzzzzzzzzzzzzzzzz cccccccccccccccc ooooooooooo + bbbbbbbb + b::::::b iiii + b::::::b i::::i + b::::::b iiii + b:::::b + b:::::bbbbbbbbb rrrrr rrrrrrrrr iiiiiiizzzzzzzzzzzzzzzzz cccccccccccccccc ooooooooooo + b::::::::::::::bb r::::rrr:::::::::ri:::::iz:::::::::::::::z cc:::::::::::::::coo:::::::::::oo + b::::::::::::::::br:::::::::::::::::ri::::iz::::::::::::::z c:::::::::::::::::o:::::::::::::::o + b:::::bbbbb:::::::rr::::::rrrrr::::::i::::izzzzzzzz::::::z c:::::::cccccc:::::o:::::ooooo:::::o + b:::::b b::::::br:::::r r:::::i::::i z::::::z c::::::c cccccco::::o o::::o + b:::::b b:::::br:::::r rrrrrri::::i z::::::z c:::::c o::::o o::::o + b:::::b b:::::br:::::r i::::i z::::::z c:::::c o::::o o::::o + b:::::b b:::::br:::::r i::::i z::::::z c::::::c cccccco::::o o::::o + b:::::bbbbbb::::::br:::::r i::::::i z::::::zzzzzzzc:::::::cccccc:::::o:::::ooooo:::::o + b::::::::::::::::b r:::::r i::::::iz::::::::::::::zc:::::::::::::::::o:::::::::::::::o + b:::::::::::::::b r:::::r i::::::z:::::::::::::::z cc:::::::::::::::coo:::::::::::oo + bbbbbbbbbbbbbbbb rrrrrrr iiiiiiizzzzzzzzzzzzzzzzz cccccccccccccccc ooooooooooo - soli chizi bood bgo hossein__masoomi + soli chizi bood bgo hossein__masoomi - `); + `); const token = localStorage.getItem("token"); // if (!token) { // router.push("/app/login"); @@ -1619,7 +1614,6 @@ export default function RootLayout({ children }) { CheckUser(); } }, []); - return ( - - - {children} - {shouldRenderComponent && } - - - - + {children} + {shouldRenderComponent && } + + + + - {openTimePicker && } - - + {openTimePicker && } ); -} +}; + +export default RootData; diff --git a/components/TaskPage/ActivityCardFake/page.jsx b/components/TaskPage/ActivityCardFake/page.jsx index 4669360..37a3724 100644 --- a/components/TaskPage/ActivityCardFake/page.jsx +++ b/components/TaskPage/ActivityCardFake/page.jsx @@ -9,7 +9,8 @@ import SimpleReactValidator from "simple-react-validator"; import PersianNumber from "plugins/PersianNumber"; import moment from "jalali-moment"; -const ActivityCardFake = ({ data }) => { +const ActivityCardFake = ({ data, type }) => { + console.log("data", data); const CTX = useContext(AppContext); const [conditionTask, setConditionTask] = useState(0); @@ -52,7 +53,7 @@ const ActivityCardFake = ({ data }) => { return (
{ data?.status == 3 ? "fuck-click " : "" - }`} + }${type == "fa" ? "rtl" : "ltr"}`} >
- {data?.scheduleType == 0 - ? "daily" - : data?.scheduleType == 1 - ? "weekly" - : data?.scheduleType == 2 - ? "special" - : ""} + {type == "fa" ? ( + <> + {data?.scheduleType == 0 + ? "روزانه" + : data?.scheduleType == 1 + ? "هفتگی" + : data?.scheduleType == 2 + ? "مخصوص" + : ""} + + ) : ( + <> + {data?.scheduleType == 0 + ? "daily" + : data?.scheduleType == 1 + ? "weekly" + : data?.scheduleType == 2 + ? "special" + : ""} + + )}
diff --git a/components/landingComponents/Experience.jsx b/components/landingComponents/Experience.jsx index ec86915..f4c1bef 100644 --- a/components/landingComponents/Experience.jsx +++ b/components/landingComponents/Experience.jsx @@ -12,12 +12,41 @@ import "react-vertical-timeline-component/style.min.css"; import { SectionWrapper } from "src/hoc"; import { textVariant } from "src/utils/motion"; import { styles } from "src/style"; -import { experiences } from "src/constans"; -import { activityFake } from "datacalender"; +import { activityFake, activityFakeFa } from "datacalender"; import ActivityCardFake from "@comp/TaskPage/ActivityCardFake/page"; +import { useLocale, useTranslations } from "next-intl"; + +const experiences = () => { + const t = useTranslations("experiences"); + return [ + { + title: t("insertTasks.title"), + points: t("insertTasks.points"), + }, + { + title: t("createShiftPlan.title"), + points: t("createShiftPlan.points"), + }, + { + title: t("specificPerson.title"), + points: t("specificPerson.points"), + }, + { + title: t("realTime.title"), + points: t("realTime.points"), + }, + { + title: t("confirmsCompletion.title"), + points: t("confirmsCompletion.points"), + }, + ]; +}; const ExperienceCard = ({ experience }) => { + console.log(experience); const [isMobile, setIsMobile] = useState(false); + const locale = useLocale(); + const isRTL = locale === "fa"; useEffect(() => { // Check window size after the component mounts @@ -40,9 +69,7 @@ const ExperienceCard = ({ experience }) => { borderRadius: "15px", }} contentArrowStyle={{ borderRight: "7px solid #35685952" }} - date={experience.date} iconStyle={{ - background: experience.iconBg, // Customize background color: "#fff", // Customize icon color boxShadow: "0 0 0 4px #35685952", // Add shadow or border display: "flex", @@ -57,30 +84,30 @@ const ExperienceCard = ({ experience }) => { }} >
-

{experience.title}

-

- {experience.company_name} -

+ {experience.title} +
-
    - {experience.points.map((point, index) => ( -
  • - {point} -
  • - ))} +
      +
    • + {experience.points} +
    ); }; const Experience = () => { + const t = useTranslations("experiences"); + + const locale = useLocale(); + const isRTL = locale === "fa"; + const [number, setNumber] = useState(4521); const [prevNumber, setPrevNumber] = useState(4521); @@ -104,21 +131,24 @@ const Experience = () => { return ( <> -

    - - B - - ase logics{" "} -

    + {isRTL ? ( +

    + {t("title")} +

    + ) : ( +

    + + B + + ase logics{" "} +

    + )}
    -
    +
    - {experiences.map((experience, index) => ( - + {experiences().map((e, index) => ( + ))}
    @@ -127,11 +157,14 @@ const Experience = () => {

    - Number of tasks completed in Briz + {t("taskText")}{" "}

    - +
    @@ -169,7 +202,7 @@ const Experience = () => { ))}

    - Activities performed with Briz + {t("LiveNumberTask")}{" "}

    diff --git a/components/landingComponents/Feedbacks.jsx b/components/landingComponents/Feedbacks.jsx index 4d4add5..ece9b80 100644 --- a/components/landingComponents/Feedbacks.jsx +++ b/components/landingComponents/Feedbacks.jsx @@ -5,7 +5,7 @@ import { motion } from "framer-motion"; import { SectionWrapper } from "src/hoc"; import { fadeIn, textVariant } from "src/utils/motion"; import { styles } from "src/style"; -import { testimonials } from "src/constans"; +import { testimonials } from "src/constans/"; import Image from "next/image"; import phi from "@img/adjustw.png"; import phi1 from "../../src/assets/phi1.png"; diff --git a/components/landingComponents/Footer/page.jsx b/components/landingComponents/Footer/page.jsx index 3b85705..69a4469 100644 --- a/components/landingComponents/Footer/page.jsx +++ b/components/landingComponents/Footer/page.jsx @@ -2,23 +2,40 @@ import React, { version } from "react"; import logo2 from "../../../src/assets/logo2.png"; import Image from "next/image"; import Link from "next/link"; +import { useLocale } from "next-intl"; const Footer = () => { + const locale = useLocale(); + const isRTL = locale === "fa"; return (
    -
    - -
    -

    - " - Briz, Harmonious routine -

    -

    - management - " -

    +
    + {isRTL ? ( + <> +

    + " + بریز، مدیریت هارمونیک{" "} +

    +

    + روتین ها + " +

    + + ) : ( + <> + {" "} +

    + " + Briz, Harmonious routine +

    +

    + management + " +

    + + )}
    diff --git a/components/landingComponents/Hero.jsx b/components/landingComponents/Hero.jsx index 13b57b4..5f241c9 100644 --- a/components/landingComponents/Hero.jsx +++ b/components/landingComponents/Hero.jsx @@ -2,8 +2,13 @@ import Link from "next/link"; import MovingLogos from "./MovingLogos/page"; import { motion } from "framer-motion"; import { fadeIn, textVariant } from "src/utils/motion"; +import { useTranslations } from "next-intl"; const Hero = () => { + const t = useTranslations("page"); + + console.log("ssssst", t); + return (
    @@ -17,7 +22,7 @@ const Hero = () => { className="font-black text-white text-[40px] xs:text-[30px] sm:text-[140px] lg:text-[60px] leading-tight mb-0 space-x-6 text-center" style={{ wordSpacing: "10px" }} > - SIMPLE AND SMOOTH OPERATION + {t("title")} @@ -27,16 +32,14 @@ const Hero = () => {

    - A task and shift management solution for coffee shops that - provides clear, trackable task management and monitoring of store - operations. + {t("desc")}

    @@ -45,7 +48,7 @@ const Hero = () => {

    - Brands that trust us and use BRIZ for their managing. + {t("brand")}{" "}

    diff --git a/components/landingComponents/Navbar.jsx b/components/landingComponents/Navbar.jsx index 9173c10..aa119c8 100644 --- a/components/landingComponents/Navbar.jsx +++ b/components/landingComponents/Navbar.jsx @@ -3,15 +3,56 @@ import React, { useEffect, useState } from "react"; import { menu, close } from "src/assets"; import { styles } from "src/style"; -import { navLinks } from "src/constans"; import Link from "next/link"; import logo2 from "../../src/assets/logo2.png"; import Image from "next/image"; +import { useLocale, useTranslations } from "next-intl"; +import PersianNumberMemo from "plugins/PersianNumber"; +import { routing } from "../../src/i18n/routing"; +import { useRouter } from "next/navigation"; + +// Fix the `useTranslations` key (removed space at the end) +const navLinks = () => { + const t = useTranslations("navLinks"); + return [ + { + id: "our-solution", + title: t("ourSolution"), + go: false, + }, + { + id: "product", + title: t("product"), + go: false, + }, + { + id: "pricing", + title: t("pricing"), + go: true, + }, + { + id: "about-us", + title: t("aboutUs"), + go: true, + }, + ]; +}; const Navbar = () => { const [active, setActive] = useState(""); const [toggle, setToggle] = useState(false); const [scrolled, setScrolled] = useState(false); + const [isOpenLang, setIsOpenLang] = useState(false); // To toggle the dropdown + + const t = useTranslations("navLinks"); + + const locale = useLocale(); + const router = useRouter(); + + const isRTL = locale === "fa"; + + // Call `navLinks` once at the beginning + const navItems = navLinks(); useEffect(() => { const handleScroll = () => { @@ -28,13 +69,30 @@ const Navbar = () => { return () => window.removeEventListener("scroll", handleScroll); }, []); + const availableLocales = [ + { code: "en", name: "en" }, + { code: "fa", name: "فا" }, // Persian (RTL) + { code: "zh", name: "中文" }, + ]; + + // Function to change the locale + const changeLocale = (newLocale) => { + // Navigate to the same route but with a different locale + router.push(newLocale); + setIsOpenLang(false); // Close the dropdown + }; + return (