From 48bbd9ae85777306321fd603cee33677c2b59040 Mon Sep 17 00:00:00 2001 From: Mohammed Al-yaseen Date: Sat, 29 Nov 2025 13:18:17 +0300 Subject: [PATCH] enhnace login styles on desktop and tablet screens --- src/components/ProHeader/ProHeader.tsx | 1 + .../components/CartMobileTabletLayout.tsx | 5 +- src/pages/login/login.module.css | 156 +++++++++++++ src/pages/login/page.tsx | 217 ++++++++++-------- src/pages/otp/otp.module.css | 90 ++++++++ src/pages/otp/page.tsx | 123 +++++----- 6 files changed, 428 insertions(+), 164 deletions(-) diff --git a/src/components/ProHeader/ProHeader.tsx b/src/components/ProHeader/ProHeader.tsx index 578f564..7b65769 100644 --- a/src/components/ProHeader/ProHeader.tsx +++ b/src/components/ProHeader/ProHeader.tsx @@ -47,6 +47,7 @@ const ProHeader: FunctionComponent = ({ backgroundColor: themeName === "light" ? "white" : ProBlack2, height: isMobile ? "8vh" : "6vh", // Set a fixed height for the container padding: "4px 16px 0px 16px", // Add some horizontal padding + width: "100%", }} > - - + + + + {t("login.EnterYourNumber")} 👋 + + {t( + "login.WeWillSendYouAWhatsAppMessageWithAOneTimeVerificationCode", + )} + + +
+ + + + + + setIsOpen(true)} + readOnly + value={selectedDate} + style={{ + cursor: "pointer", + height: 50, + fontSize: 14, + }} + /> + + + + + + + + + + - + ); } diff --git a/src/pages/otp/otp.module.css b/src/pages/otp/otp.module.css index 1ca57b6..1a0c866 100644 --- a/src/pages/otp/otp.module.css +++ b/src/pages/otp/otp.module.css @@ -1,3 +1,93 @@ +/* OTP Page Styles */ +.otpPage { + background-color: var(--secondary-background); + padding: 16px; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + text-align: center; + height: 100vh; +} + +:global(.darkApp) .otpPage { + background-color: var(--background); +} + +.otpWrapper { + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.otpContainer { + width: 100%; + max-width: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 24px; +} + +.otpContent { + display: flex; + flex-direction: column; + gap: 8px; +} + +.otpTitle { + margin: 0; +} + +.otpInputContainer { + width: 100%; + display: flex; + justify-content: center; +} + +.otpButton { + width: 100%; + height: 48px; + margin-bottom: 16px; + color: white; + border: none; + box-shadow: none; +} + +/* Tablet devices (min-width: 769px and max-width: 1024px) */ +@media (min-width: 769px) and (max-width: 1024px) { + .otpPage { + padding: 24px; + align-items: center; + justify-content: center; + } + + .otpWrapper { + width: 100%; + display: flex; + align-items: center; + justify-content: center; + } + + .otpContainer { + max-width: 500px; + width: 100%; + background-color: var(--background); + padding: 48px 40px; + border-radius: 24px; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); + margin: 0 auto; + } +} + +:global(.darkApp) .otpContainer { + background-color: var(--secondary-background); + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); +} + .productContainer :global(.ant-radio-wrapper:last-child) { width: 100% !important; } diff --git a/src/pages/otp/page.tsx b/src/pages/otp/page.tsx index 57998ba..6c11228 100644 --- a/src/pages/otp/page.tsx +++ b/src/pages/otp/page.tsx @@ -1,4 +1,4 @@ -import { Button, Space, message } from "antd"; +import { Button, Layout, Space, message } from "antd"; import OtpIcon from "components/Icons/otpIcon.tsx"; import OtpInput from "components/OtpInput/OtpInput"; import ProText from "components/ProText"; @@ -10,6 +10,9 @@ import { useNavigate, useParams } from "react-router-dom"; import { useConfirmOtpMutation, useSendOtpMutation } from "redux/api/auth"; import { useAppDispatch } from "redux/hooks"; import { ProGray1 } from "ThemeConstants"; +import styles from "./otp.module.css"; +import ProHeader from "components/ProHeader/ProHeader"; +import useBreakPoint from "hooks/useBreakPoint"; export default function OtpPage() { const { subdomain } = useParams(); @@ -18,6 +21,7 @@ export default function OtpPage() { const [sendOtp, { isLoading }] = useSendOtpMutation(); const [confirmOtp, { isLoading: isConfirmLoading }] = useConfirmOtpMutation(); const [otp, setOtp] = useState(""); + const { isTablet } = useBreakPoint(); const handleOtpSave = (otp: string) => { try { setOtp(otp); @@ -28,70 +32,61 @@ export default function OtpPage() { const navigate = useNavigate(); return ( - <> -
- + + {isTablet ? {t("otp.verification")} : null} -
- {t("otp.verification")} - - {t("otp.enterThe4DigitCodeThatSentToYourPhoneNumber")} - -
- - {localStorage.getItem("otp")} - + +
+ + +
+ + {t("otp.verification")} + + + {t("otp.enterThe4DigitCodeThatSentToYourPhoneNumber")} + +
+ + {localStorage.getItem("otp")} + +
+
+ + + sendOtp({ + phone: localStorage.getItem("userPhone") || "", + }) + } + isLoading={isLoading || isConfirmLoading} + /> + +
+
-
- - - sendOtp({ - phone: localStorage.getItem("userPhone") || "", - }) - } - isLoading={isLoading || isConfirmLoading} - /> - -
- -
- + +
); }