feat: Add user type selection and a sign up link to the login page.

This commit is contained in:
pradeepkumar
2026-03-11 11:50:03 +05:30
parent fd480992a3
commit a3586021a4

View File

@@ -13,6 +13,7 @@ export default function LoginPage() {
const [showPassword, setShowPassword] = useState(false);
const [error, setError] = useState('');
const [loading, setLoading] = useState(false);
const [userType, setUserType] = useState<'USER' | 'ADMIN'>('USER');
// Safety net: clear logout flags when login page loads.
// This resets both the localStorage flag and the module-level flag in api.ts
@@ -95,13 +96,23 @@ export default function LoginPage() {
<div className="inline-flex bg-[#f0f5fc] rounded-[15px] p-0.5">
<button
type="button"
className="px-10 py-2 text-[14px] font-semibold rounded-[15px] transition-all duration-200 font-serif bg-[#00293d] text-[#f0f5fc] border border-[#00293d]"
onClick={() => setUserType('USER')}
className={`px-10 py-2 text-[14px] font-semibold rounded-[15px] transition-all duration-200 font-serif ${
userType === 'USER'
? 'bg-[#00293d] text-[#f0f5fc] border border-[#00293d]'
: 'text-[#00293d]'
}`}
>
User
</button>
<button
type="button"
className="px-10 py-2 text-[14px] font-semibold rounded-[15px] transition-all duration-200 font-serif text-[#00293d]"
onClick={() => setUserType('ADMIN')}
className={`px-10 py-2 text-[14px] font-semibold rounded-[15px] transition-all duration-200 font-serif ${
userType === 'ADMIN'
? 'bg-[#00293d] text-[#f0f5fc] border border-[#00293d]'
: 'text-[#00293d]'
}`}
>
Admin
</button>
@@ -217,6 +228,14 @@ export default function LoginPage() {
<img src="/assets/icons/facebook.svg" alt="Facebook" className="w-6 h-6" />
</button>
</div>
{/* Don't Have Account */}
<div className="text-center mt-8">
<span className="text-[#00293d] text-[14px] font-serif">Don&apos;t Have An Account ? </span>
<Link href="/signup" className="text-[#00293d] font-bold text-[14px] font-fractul hover:underline">
Sign Up
</Link>
</div>
</>
);
}