22
33import { Suspense , useState , useTransition , useEffect } from "react" ;
44import { useRouter , useSearchParams } from "next/navigation" ;
5+ import Link from "next/link" ;
56import { loginAdmin } from "@/actions/admin/auth" ;
67function LoginContent ( ) {
78 const router = useRouter ( ) ;
@@ -53,20 +54,29 @@ function LoginContent() {
5354 } ;
5455
5556 return (
56- < div className = "relative w-full max-w-md border border-zinc-800 bg-[#0F0F0F] p-8 transition-all duration-300 md:p-12" >
57+ < div className = "relative w-full max-w-md border border-zinc-200 bg-white p-8 pt-16 transition-all duration-300 md:p-12 md:pt-16 shadow-sm" >
58+ { /* Back to Home Button */ }
59+ < Link
60+ href = "/"
61+ className = "group absolute top-6 left-6 inline-flex items-center gap-x-1.5 text-xs text-zinc-500 hover:text-black-1 transition-colors duration-300"
62+ >
63+ < span className = "text-[14px] font-medium transition-transform duration-300 group-hover:-translate-x-0.5" > ←</ span >
64+ < span > Back to Site</ span >
65+ </ Link >
66+
5767 { /* Header */ }
5868 < div className = "mb-8 text-center" >
5969 < span className = "mb-3 block text-[11px] font-medium tracking-[0.25em] text-zinc-500 uppercase" >
6070 Devix Operations
6171 </ span >
62- < h1 className = "font-display text-2xl font-light tracking-wide text-zinc-100 md:text-3xl" >
72+ < h1 className = "font-display text-2xl font-light tracking-wide text-zinc-900 md:text-3xl" >
6373 Control Panel Login
6474 </ h1 >
6575 </ div >
6676
6777 { /* Error Alert */ }
6878 { errorMessage && (
69- < div className = "mb-6 border-l border-red-500 bg-red-950/20 p-4 font-sans text-xs leading-relaxed text-red-400 " >
79+ < div className = "mb-6 border-l border-red-500 bg-red-50 p-4 font-sans text-xs leading-relaxed text-red-600 " >
7080 { errorMessage }
7181 </ div >
7282 ) }
@@ -79,7 +89,7 @@ function LoginContent() {
7989 < div className = "space-y-2" >
8090 < label
8191 htmlFor = "email"
82- className = "block text-[11px] font-medium tracking-wider text-zinc-400 uppercase"
92+ className = "block text-[11px] font-medium tracking-wider text-zinc-500 uppercase"
8393 >
8494 Email Address
8595 </ label >
@@ -91,14 +101,14 @@ function LoginContent() {
91101 disabled = { isPending }
92102 placeholder = "name@company.com"
93103 required
94- className = "w-full rounded-none border border-zinc-800 bg-[#141414] px-4 py-3 text-sm text-white placeholder-zinc-600 transition-colors duration-300 focus:border-[#C8A96E] focus:outline-none"
104+ className = "w-full rounded-none border border-zinc-200 bg-zinc-50 px-4 py-3 text-sm text-zinc-900 placeholder-zinc-400 transition-all duration-300 focus:border-[#C8A96E] focus:bg-white focus:outline-none"
95105 />
96106 </ div >
97107
98108 < div className = "space-y-2" >
99109 < label
100110 htmlFor = "password"
101- className = "block text-[11px] font-medium tracking-wider text-zinc-400 uppercase"
111+ className = "block text-[11px] font-medium tracking-wider text-zinc-500 uppercase"
102112 >
103113 Password
104114 </ label >
@@ -110,14 +120,14 @@ function LoginContent() {
110120 disabled = { isPending }
111121 placeholder = "••••••••"
112122 required
113- className = "w-full rounded-none border border-zinc-800 bg-[#141414] px-4 py-3 text-sm text-white placeholder-zinc-600 transition-colors duration-300 focus:border-[#C8A96E] focus:outline-none"
123+ className = "w-full rounded-none border border-zinc-200 bg-zinc-50 px-4 py-3 text-sm text-zinc-900 placeholder-zinc-400 transition-all duration-300 focus:border-[#C8A96E] focus:bg-white focus:outline-none"
114124 />
115125 </ div >
116126
117127 < button
118128 type = "submit"
119129 disabled = { isPending }
120- className = "flex w-full items-center justify-center gap-2 bg-[#C8A96E] py-4 font-sans text-xs font-medium tracking-[0.2em] text-black uppercase transition-colors duration-300 hover:bg-[#B6965C] disabled:bg-zinc-800 disabled:text-zinc-500 "
130+ className = "flex w-full items-center justify-center gap-2 bg-[#C8A96E] py-4 font-sans text-xs font-medium tracking-[0.2em] text-black uppercase transition-colors duration-300 hover:bg-[#B6965C] disabled:bg-zinc-100 disabled:text-zinc-400 "
121131 >
122132 { isPending ? "Verifying..." : "Authenticate" }
123133 </ button >
@@ -128,12 +138,12 @@ function LoginContent() {
128138
129139export default function AdminLoginPage ( ) {
130140 return (
131- < div className = "relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#0A0A0A] px-6 text-white selection:bg-[#C8A96E]/30 selection:text-white " >
141+ < div className = "relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-zinc-50 px-6 text-zinc-900 selection:bg-[#C8A96E]/30 selection:text-zinc-900 " >
132142 { /* Background Decorative Grain/Gradient */ }
133- < div className = "pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-zinc-700 via-zinc-900 to-black opacity-20 " />
143+ < div className = "pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-zinc-200 via-zinc-100 to-white opacity-40 " />
134144 < Suspense
135145 fallback = {
136- < div className = "text-xs tracking-widest text-zinc-500 uppercase" >
146+ < div className = "text-xs tracking-widest text-zinc-400 uppercase" >
137147 Loading interface...
138148 </ div >
139149 }
@@ -143,3 +153,4 @@ export default function AdminLoginPage() {
143153 </ div >
144154 ) ;
145155}
156+
0 commit comments