store code fix

This commit is contained in:
suryac 2026-08-03 13:46:56 +05:30
parent 810e4997ae
commit e8bc418d02

View File

@ -2,7 +2,8 @@ import { useState, type FormEvent } from 'react';
import { Navigate, useNavigate } from 'react-router-dom'; import { Navigate, useNavigate } from 'react-router-dom';
import { useAuth } from '../auth/context'; import { useAuth } from '../auth/context';
import { Button } from '../components/buttons'; import { Button } from '../components/buttons';
import { Card, Input } from '../components/reusable'; import { Card } from '../components/reusable';
import logo from '../assets/logo.png';
/** Login gate. Redirects to /daily once authenticated. */ /** Login gate. Redirects to /daily once authenticated. */
export function LoginPage() { export function LoginPage() {
@ -30,16 +31,25 @@ export function LoginPage() {
} }
return ( return (
<div className="min-h-screen flex items-center justify-center p-4 bg-app"> <div className="min-h-screen flex items-center justify-center p-4 bg-emerald-50">
<Card className="w-full max-w-[400px]"> <Card className="w-full max-w-[400px] shadow-lg border-emerald-100">
<div className="flex flex-col gap-1 mb-5"> <div className="flex flex-col gap-3 items-center mb-6">
<h1 className="m-0 text-2xl font-extrabold text-strong tracking-[-0.02em]">Krishna Sales</h1> <img src={logo} alt="Krishna Sales Logo" className="h-16 w-auto object-contain" />
<h1 className="m-0 text-2xl font-extrabold text-emerald-900 tracking-[-0.02em]">Krishna Sales</h1>
</div> </div>
<form onSubmit={submit} className="flex flex-col gap-4"> <form onSubmit={submit} className="flex flex-col gap-4">
<Input label="Email" type="email" value={email} onChange={(e) => setEmail(e.target.value)} required autoFocus /> <label className="flex flex-col gap-1.5 font-sans">
<Input label="Password" type="password" value={password} onChange={(e) => setPassword(e.target.value)} required /> <span className="text-sm font-semibold text-emerald-800">Email <span className="text-emerald-500">*</span></span>
<input type="email" value={email} onChange={(e) => setEmail(e.target.value)} required autoFocus
className="h-[42px] px-3 border border-emerald-200 bg-emerald-50/50 rounded-md outline-none focus:ring-2 focus:ring-emerald-400 focus:border-emerald-400 transition-all text-emerald-900 placeholder:text-emerald-300" placeholder="Enter your email" />
</label>
<label className="flex flex-col gap-1.5 font-sans">
<span className="text-sm font-semibold text-emerald-800">Password <span className="text-emerald-500">*</span></span>
<input type="password" value={password} onChange={(e) => setPassword(e.target.value)} required
className="h-[42px] px-3 border border-emerald-200 bg-emerald-50/50 rounded-md outline-none focus:ring-2 focus:ring-emerald-400 focus:border-emerald-400 transition-all text-emerald-900 placeholder:text-emerald-300" placeholder="Enter your password" />
</label>
{error && <div className="text-xs text-ruby-600 font-medium">{error}</div>} {error && <div className="text-xs text-ruby-600 font-medium">{error}</div>}
<Button type="submit" full disabled={busy}> <Button type="submit" full disabled={busy} className="mt-2 bg-emerald-600 hover:bg-emerald-700 text-white border-transparent">
{busy ? 'Signing in…' : 'Sign in'} {busy ? 'Signing in…' : 'Sign in'}
</Button> </Button>
</form> </form>