change name in register & add link to most-searched home page & change tag & change design and responsive & fix active link header & must include field num in register & send code msg

This commit is contained in:
Ehsan
2025-05-13 22:07:03 +03:30
parent cd3114d308
commit a8a320465d
37 changed files with 192 additions and 172 deletions
+3 -15
View File
@@ -1,23 +1,11 @@
"use client";
import RegisterPage from "@/components/register";
import SetCodePage from "@/components/register/SetCodePage";
import LogInPage from "@/components/register/LogInPage";
import { useState } from "react";
import { getStateInfo } from "@/lib/getStateInfo";
function ContentLogin() {
const [isSendMsg, setIsSendMsg] = useState(false);
const { matchedCity } = getStateInfo();
return (
<div>
<RegisterPage>
{isSendMsg ? (
<SetCodePage setIsSendMsg={setIsSendMsg} setStep={false} link="/" />
) : (
<LogInPage setStep={false} setIsSendMsg={setIsSendMsg} />
)}
</RegisterPage>
</div>
<RegisterPage matchedCity={matchedCity} />
);
}
+44
View File
@@ -0,0 +1,44 @@
import Image from "next/image";
import Link from "next/link";
const about = ["سوالات متداول", "تماس با ما", "درباره ما"];
function LayoutRegister({ children, matchedCity }) {
return (
<div
className="flex padding-responsive items-center justify-center pt-[32px]
overflow-auto flex-col h-screen w-full bg-banner-stroke !bg-bottom !bg-no-repeat !bg-cover
!pb-[calc(108px_+_40px)] md:!pb-[calc(111px_+_40px)]"
>
<Link href="/">
<div className="flex items-center justify-center gap-[5px] sm:mt-0">
<Image
src="/assets/images/logo.png"
width={40}
height={40}
alt="logo"
/>
<p className="text-[#5559CE] text-[20px] font-bold">{matchedCity?.site_name || "نوبت ۷۲۴"}</p>
</div>
</Link>
{children}
<div className="fixed bottom-0 left-0 bg-[#FAFAFA] w-full pb-[50px] px-[18px] sm:px-[67px] md:px[117px] lg:px-[166px]">
<div className="bg-border-t-gradient-sign h-px w-full"></div>
<div className="flex items-center justify-center gap-[32px] sm:gap-[40px] md:gap-[48px] lg:gap-[56px] mt-[24px]">
{about.map((item, idx) => (
<Link href="/" key={idx}>
<p
className="text-[#494CB3] text-[14px] md:text-[16px] font-normal"
key={idx}
>
{item}
</p>
</Link>
))}
</div>
</div>
</div>
)
}
export default LayoutRegister
+6 -4
View File
@@ -4,13 +4,15 @@ import { Button, InputAdornment } from "@mui/material";
import Link from "next/link";
import { useState } from "react";
function LogInPage({ setIsSendMsg, setStep }) {
function LogInPage({ setIsSendMsg, setStep, matchedCity }) {
const [num, setNum] = useState("");
const [error, setError] = useState({ valid: true, text: '' });
const handleChange = (val) => {
!error.valid && setError({ ...error, valid: true });
const formatted = formatPhoneNumber(val);
const checkedNum = validatePhoneNumber(formatted);
setError(checkedNum);
setNum(formatted);
};
@@ -20,7 +22,7 @@ function LogInPage({ setIsSendMsg, setStep }) {
p-0 border-transparent sm:p-[40px] sm:pb-[48px] w-full sm:w-fit sm:min-w-[425px]"
>
<p className="text-[#525252] text-[18px] font-bold">
ورود یا ثبت نام در نوبت 724
ورود یا ثبت نام در {matchedCity?.site_name || "نوبت 724"}
</p>
<p className="text-[#616161] text-[14px] mt-[40px] sm:mt-[43px] md:mt-[46px] lg:mt-[48px] font-normal">
شماره همراه خود را وارد نمایید.
@@ -76,7 +78,7 @@ function LogInPage({ setIsSendMsg, setStep }) {
<Link href="/">
<span className="text-[#F17732] underline">قوانین استفاده</span>
</Link>{" "}
از نوبت 724 را می پذیرم.
از {matchedCity?.site_name || 'نوبت 724'} را می پذیرم.
</p>
</div>
);
+15 -37
View File
@@ -1,43 +1,21 @@
import Image from "next/image";
import Link from "next/link";
"use client";
const about = ["سوالات متداول", "تماس با ما", "درباره ما"];
import SetCodePage from "@/components/register/SetCodePage";
import LogInPage from "@/components/register/LogInPage";
import { useState } from "react";
import LayoutRegister from "./LayoutRegister";
function RegisterPage({ matchedCity }) {
const [isSendMsg, setIsSendMsg] = useState(false);
function RegisterPage({ children }) {
return (
<div
className="flex padding-responsive items-center justify-center pt-[32px]
overflow-auto flex-col h-screen w-full bg-banner-stroke !bg-bottom !bg-no-repeat !bg-cover
!pb-[calc(108px_+_40px)] md:!pb-[calc(111px_+_40px)]"
>
<Link href="/">
<div className="flex items-center justify-center gap-[5px] sm:mt-0">
<Image
src="/assets/images/logo.png"
width={40}
height={40}
alt="logo"
/>
<p className="text-[#5559CE] text-[20px] font-bold">نوبت ۷۲۴</p>
</div>
</Link>
{children}
<div className="fixed bottom-0 left-0 bg-[#FAFAFA] w-full pb-[50px] px-[18px] sm:px-[67px] md:px[117px] lg:px-[166px]">
<div className="bg-border-t-gradient-sign h-px w-full"></div>
<div className="flex items-center justify-center gap-[32px] sm:gap-[40px] md:gap-[48px] lg:gap-[56px] mt-[24px]">
{about.map((item, idx) => (
<Link href="/" key={idx}>
<p
className="text-[#494CB3] text-[14px] md:text-[16px] font-normal"
key={idx}
>
{item}
</p>
</Link>
))}
</div>
</div>
</div>
<LayoutRegister matchedCity={matchedCity}>
{isSendMsg ? (
<SetCodePage setIsSendMsg={setIsSendMsg} setStep={false} link="/" />
) : (
<LogInPage matchedCity={matchedCity} setStep={false} setIsSendMsg={setIsSendMsg} />
)}
</LayoutRegister>
);
}