From 5070f36c8e2c844ffb71f783c8c42d60f1508c61 Mon Sep 17 00:00:00 2001 From: MHR81 Date: Thu, 25 Dec 2025 11:33:25 +0330 Subject: [PATCH] fix begaii --- src/pages/Login/Login.jsx | 49 +++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/src/pages/Login/Login.jsx b/src/pages/Login/Login.jsx index 903bbb3..9de7c6c 100644 --- a/src/pages/Login/Login.jsx +++ b/src/pages/Login/Login.jsx @@ -1,11 +1,11 @@ -import React, { useState } from "react"; +import React, { useState, useEffect } from "react"; import { useNavigate } from "react-router-dom"; import { useDispatch } from "react-redux"; import { FiLock } from "react-icons/fi"; import { FaRegUser } from "react-icons/fa6"; // Assets -import Loginpic from "../../assets/image/loginpic.jpg"; +import Loginpic from "../../../src/assets/image/loginpic.jpg"; import LogoDM from "../../assets/icons/LogoDM.svg"; // Redux @@ -24,6 +24,16 @@ export default function Login() { const [password, setPassword] = useState(""); const [loading, setLoading] = useState(false); const [error, setError] = useState(""); + const [isMobile, setIsMobile] = useState(window.innerWidth < 768); + + useEffect(() => { + const handleResize = () => { + setIsMobile(window.innerWidth < 768); + }; + + window.addEventListener('resize', handleResize); + return () => window.removeEventListener('resize', handleResize); + }, []); // Handle Login const handleLogin = async (e) => { @@ -92,8 +102,17 @@ export default function Login() { {/* Main Content */}
{/* Left Side - Login Form */} -
-
+
+ {/* Dark Overlay */} +
+
{/* Breadcrumb */}
ورود @@ -103,8 +122,8 @@ export default function Login() { {/* Header */}
-

ورود ادمین

-

دسترسی ویژه برای مدیریت و گزارش‌ها

+

ورود ادمین

+

دسترسی ویژه برای مدیریت و گزارش‌ها

{/* Login Form */} @@ -118,14 +137,14 @@ export default function Login() { {/* Username Field */}
- -
+ +
setUserName(e.target.value)} placeholder="userName" - className="w-full pl-12 pr-4 py-3 border-2 border-gray-300 rounded-xl focus:outline-none focus:border-[#7f4629] transition-colors text-sm" + className="w-full pl-12 pr-4 py-3 border-2 bg-[#f5f0e8] border-gray-300 rounded-xl focus:outline-none focus:border-[#7f4629] transition-colors text-sm" dir="ltr" required /> @@ -135,14 +154,14 @@ export default function Login() { {/* Password Field */}
- -
+ +
setPassword(e.target.value)} placeholder="password" - className="w-full pl-12 pr-4 py-3 border-2 border-gray-300 rounded-xl focus:outline-none focus:border-[#7f4629] transition-colors text-sm" + className="w-full pl-12 pr-4 py-3 border-2 bg-[#f5f0e8] border-gray-300 rounded-xl focus:outline-none focus:border-[#7f4629] transition-colors text-sm" dir="ltr" required /> @@ -152,7 +171,7 @@ export default function Login() { {/* Forgot Password */} @@ -170,8 +189,8 @@ export default function Login() {
{/* Right Side - Image (Hidden on Mobile) */} -
- Coffee workspace +
+ Coffee workspace