From 10287b4bfdd316b4362816fe272ea5c401da48a8 Mon Sep 17 00:00:00 2001 From: ghost2023 Date: Thu, 28 May 2026 13:47:36 +0300 Subject: [PATCH] style(auth): Apply updated design system guidelines to all authentication forms --- .../portal/src/components/auth/AuthLayout.tsx | 40 ++--- .../portal/src/pages/accounts/LoginPage.tsx | 147 ++++++++-------- .../src/pages/accounts/SetPasswordPage.tsx | 130 ++++++++------ .../portal/src/pages/accounts/SignupPage.tsx | 162 ++++++++++-------- .../pages/accounts/VerificationOtpPage.tsx | 111 +++++++----- 5 files changed, 324 insertions(+), 266 deletions(-) diff --git a/apps/edr-freight-web/portal/src/components/auth/AuthLayout.tsx b/apps/edr-freight-web/portal/src/components/auth/AuthLayout.tsx index c4b908a09..310cac6ca 100644 --- a/apps/edr-freight-web/portal/src/components/auth/AuthLayout.tsx +++ b/apps/edr-freight-web/portal/src/components/auth/AuthLayout.tsx @@ -21,7 +21,7 @@ export default function AuthLayout({ children, left }: AuthLayoutProps) { return (
-
+
@@ -29,16 +29,22 @@ export default function AuthLayout({ children, left }: AuthLayoutProps) {
-

EDR Freight

-

Railway Logistics Platform

+

EDR Freight

+

+ Railway Logistics Platform +

-
+
{left.badge}
-

{left.title}

-

{left.description}

+

+ {left.title} +

+

+ {left.description} +

{left.features.map((item) => ( @@ -51,33 +57,21 @@ export default function AuthLayout({ children, left }: AuthLayoutProps) { ))}
-
-
-
-

{left.stats.label}

-

{left.stats.value}

-
-
{left.stats.footer}
-
-
-
-
-
-
+

EDR Freight

-

Railway Logistics Platform

+

+ Railway Logistics Platform +

-
- {children} -
+
{children}
diff --git a/apps/edr-freight-web/portal/src/pages/accounts/LoginPage.tsx b/apps/edr-freight-web/portal/src/pages/accounts/LoginPage.tsx index 0af8d0af2..c3238f3d4 100644 --- a/apps/edr-freight-web/portal/src/pages/accounts/LoginPage.tsx +++ b/apps/edr-freight-web/portal/src/pages/accounts/LoginPage.tsx @@ -3,6 +3,14 @@ import { useNavigate } from "react-router-dom"; import { ArrowRight, Mail, Phone, Loader2 } from "lucide-react"; import useAuth from "@/hooks/useAuth"; import AuthLayout from "@/components/auth/AuthLayout"; +import { + Button, + Input, + Field, + FieldLabel, + FieldError, + FieldGroup, +} from "@edr/ui-common"; type LoginMethod = "email" | "phone"; @@ -46,116 +54,117 @@ export default function LoginPage() { "Enterprise-grade operations", "Multi-corridor freight monitoring", ], - stats: { label: "Active Corridors", value: "24+", footer: "Operational", progress: "w-[95%]" }, + stats: { + label: "Active Corridors", + value: "24+", + footer: "Operational", + progress: "w-[95%]", + }, }} > -
-
- +
+
+
-

Welcome back

-

+

Welcome back

+

Enter your credentials to access your portal

-
+
- - +
-
- - setIdentifier(e.target.value)} - required - disabled={loading} - className="h-13 w-full rounded-2xl border border-input bg-background px-4 outline-none transition focus:border-primary focus:ring-4 focus:ring-primary/10 disabled:opacity-60" - /> -
+ + + + {method === "email" ? "Email Address" : "Phone Number"} + + setIdentifier(e.target.value)} + required + disabled={loading} + /> + -
-
- - -
- setPassword(e.target.value)} - required - disabled={loading} - className="h-13 w-full rounded-2xl border border-input bg-background px-4 outline-none transition focus:border-primary focus:ring-4 focus:ring-primary/10 disabled:opacity-60" - /> -
+ +
+ Password + +
+ setPassword(e.target.value)} + required + disabled={loading} + /> +
+
{error && ( -
+
{error}
)} - +

Don't have an account?{" "} - +

diff --git a/apps/edr-freight-web/portal/src/pages/accounts/SetPasswordPage.tsx b/apps/edr-freight-web/portal/src/pages/accounts/SetPasswordPage.tsx index 268cf836e..c8f2a7184 100644 --- a/apps/edr-freight-web/portal/src/pages/accounts/SetPasswordPage.tsx +++ b/apps/edr-freight-web/portal/src/pages/accounts/SetPasswordPage.tsx @@ -3,9 +3,17 @@ import { useNavigate } from "react-router-dom"; import { useForm } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; import { z } from "zod"; -import { ArrowRight, Eye, EyeOff, LockKeyhole } from "lucide-react"; +import { ArrowRight, Eye, EyeOff, LockKeyhole, Loader2 } from "lucide-react"; import useAuth from "@/hooks/useAuth"; import AuthLayout from "@/components/auth/AuthLayout"; +import { + Button, + Input, + Field, + FieldLabel, + FieldError, + FieldGroup, +} from "@edr/ui-common"; const passwordSchema = z .object({ @@ -72,81 +80,91 @@ export default function SetPasswordPage() { stats: { label: "Security Protection", value: "256-bit", footer: "Encrypted", progress: "w-[98%]" }, }} > -
-
- +
+
+
-

Set Password

-

- Create a secure password for your EDR Freight account. +

Set Password

+

+ Create a secure password for your account.

{error && ( -
+
{error}
)} -
-
- -
- - -
- {errors.password &&

{errors.password.message}

} -
+ + + + Password +
+ + +
+ +
-
- -
- - -
- {errors.confirmPassword && ( -

{errors.confirmPassword.message}

- )} -
+ + Confirm Password +
+ + +
+ +
+
- +
); diff --git a/apps/edr-freight-web/portal/src/pages/accounts/SignupPage.tsx b/apps/edr-freight-web/portal/src/pages/accounts/SignupPage.tsx index 05affbbe8..0b4523453 100644 --- a/apps/edr-freight-web/portal/src/pages/accounts/SignupPage.tsx +++ b/apps/edr-freight-web/portal/src/pages/accounts/SignupPage.tsx @@ -3,11 +3,19 @@ import { useNavigate } from "react-router-dom"; import { useForm } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; import { z } from "zod"; -import { ArrowRight, UserPlus } from "lucide-react"; +import { ArrowRight, UserPlus, Loader2 } from "lucide-react"; import { userType } from "@/enums/userType"; import useAuth from "@/hooks/useAuth"; import type { SignupPayload } from "@/types/auth"; import AuthLayout from "@/components/auth/AuthLayout"; +import { + Button, + Input, + Field, + FieldLabel, + FieldError, + FieldGroup, +} from "@edr/ui-common"; const userSchema = z.object({ email: z.string().email("Invalid email address"), @@ -86,107 +94,115 @@ export default function SignupPage() { stats: { label: "Active Corridors", value: "24+", footer: "Operational", progress: "w-[95%]" }, }} > -
-
- +
+
+
-

Create Account

-

- Register to access EDR Freight services and railway logistics operations. +

Create Account

+

+ Register to access EDR Freight services.

{error && ( -
+
{error}
)} -
-
- - - {errors.name?.en &&

{errors.name.en.message}

} -
- -
- - - {errors.username &&

{errors.username.message}

} -
- -
- - - {errors.email &&

{errors.email.message}

} -
- -
- -
- + + + Full Name + - -
- {(errors.countryCode || errors.phone) && ( -

- {errors.countryCode?.message || errors.phone?.message} -

- )} -
+ + -
+ + + Phone Number +
+ + +
+ +
+ + + +

Already have an account? - +

diff --git a/apps/edr-freight-web/portal/src/pages/accounts/VerificationOtpPage.tsx b/apps/edr-freight-web/portal/src/pages/accounts/VerificationOtpPage.tsx index 183980e4f..a09417c01 100644 --- a/apps/edr-freight-web/portal/src/pages/accounts/VerificationOtpPage.tsx +++ b/apps/edr-freight-web/portal/src/pages/accounts/VerificationOtpPage.tsx @@ -3,10 +3,18 @@ import { useNavigate } from "react-router-dom"; import { useForm } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; import { z } from "zod"; -import { ArrowRight, MailCheck, RotateCw } from "lucide-react"; +import { ArrowRight, MailCheck, RotateCw, Loader2 } from "lucide-react"; import { verificationCodeType } from "@/enums/verificationCodeType"; import useAuth from "@/hooks/useAuth"; import AuthLayout from "@/components/auth/AuthLayout"; +import { + Button, + Input, + Field, + FieldLabel, + FieldError, + FieldGroup, +} from "@edr/ui-common"; const otpSchema = z.object({ code: z.string().regex(/^\d{6}$/, "OTP must be exactly 6 digits"), @@ -88,92 +96,105 @@ export default function VerificationOtpPage() { stats: { label: "Verification Security", value: "99.9%", footer: "Protected", progress: "w-[99%]" }, }} > -
-
- +
+
+
-

OTP Verification

-

Enter the 6-digit code sent to:

-
-

{maskedPhone}

+

OTP Verification

+

Enter the 6-digit code sent to:

+
+

{maskedPhone}

{error && ( -
+
{error}
)} {resentMessage && ( -
+
{resentMessage}
)} -
-
- - -
- {errors.code ? ( -

{errors.code.message}

- ) : ( -

Enter the OTP sent to your phone

- )} - {otpValue.length}/6 -
-
+ + + + Verification Code + +
+ {errors.code ? ( + + ) : ( +

Enter the OTP sent to your phone

+ )} + {otpValue.length}/6 +
+
+
- + - +

Didn't receive the code? - +