demo: simple UI without DB
This commit is contained in:
parent
0da7fd15b2
commit
152bf2079c
3 changed files with 41 additions and 24 deletions
|
|
@ -1,20 +1,13 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { signIn } from "next-auth/react";
|
|
||||||
import { useState } from "react";
|
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
export default function LoginPage() {
|
export default function LoginPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [status, setStatus] = useState<"idle" | "loading">("idle");
|
|
||||||
|
|
||||||
const handleLogin = async () => {
|
const handleLogin = () => {
|
||||||
setStatus("loading");
|
// For demo: just go to home
|
||||||
// Demo: auto-login with test user
|
// In real app, this connects to auth
|
||||||
await signIn("email", {
|
|
||||||
email: "manohar6839@gmail.com",
|
|
||||||
redirect: false
|
|
||||||
});
|
|
||||||
router.push("/");
|
router.push("/");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -23,13 +16,11 @@ export default function LoginPage() {
|
||||||
<div className="w-full max-w-md p-8 text-center">
|
<div className="w-full max-w-md p-8 text-center">
|
||||||
<h1 className="text-4xl font-bold mb-2">Tia</h1>
|
<h1 className="text-4xl font-bold mb-2">Tia</h1>
|
||||||
<p className="text-gray-600 mb-8">Your baby tracking companion</p>
|
<p className="text-gray-600 mb-8">Your baby tracking companion</p>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onClick={handleLogin}
|
onClick={handleLogin}
|
||||||
disabled={status === "loading"}
|
className="w-full p-4 bg-rose-400 text-white rounded-2xl font-medium shadow-md hover:bg-rose-500 transition"
|
||||||
className="w-full p-4 bg-rose-400 text-white rounded-2xl font-medium shadow-md hover:bg-rose-500 transition disabled:opacity-50"
|
|
||||||
>
|
>
|
||||||
{status === "loading" ? "Signing in..." : "Sign In"}
|
Enter App (Demo)
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,35 @@
|
||||||
import NextResponse from "next/server";
|
export default function HomePage() {
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen bg-gradient-to-br from-rose-50 to-amber-50">
|
||||||
|
<div className="container mx-auto px-4 py-8">
|
||||||
|
<div className="text-center mb-8">
|
||||||
|
<h1 className="text-3xl font-bold">Welcome to Tia 👶</h1>
|
||||||
|
<p className="text-gray-600 mt-2">Your baby tracking companion</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
export async function GET() {
|
<div className="grid grid-cols-2 gap-4 max-w-md mx-auto">
|
||||||
return NextResponse.redirect(new URL("/login", "https://tia.manohargupta.com"));
|
<button className="p-6 bg-white rounded-2xl shadow-md hover:shadow-lg transition">
|
||||||
|
<div className="text-3xl">🍼</div>
|
||||||
|
<div className="font-medium mt-2">Feeds</div>
|
||||||
|
</button>
|
||||||
|
<button className="p-6 bg-white rounded-2xl shadow-md hover:shadow-lg transition">
|
||||||
|
<div className="text-3xl">😴</div>
|
||||||
|
<div className="font-medium mt-2">Sleep</div>
|
||||||
|
</button>
|
||||||
|
<button className="p-6 bg-white rounded-2xl shadow-md hover:shadow-lg transition">
|
||||||
|
<div className="text-3xl">👶</div>
|
||||||
|
<div className="font-medium mt-2">Diaper</div>
|
||||||
|
</button>
|
||||||
|
<button className="p-6 bg-white rounded-2xl shadow-md hover:shadow-lg transition">
|
||||||
|
<div className="text-3xl">💊</div>
|
||||||
|
<div className="font-medium mt-2">Medical</div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="mt-8 text-center">
|
||||||
|
<p className="text-gray-500">Baby: Tia (2 years old)</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
import { NextResponse } from "next/server";
|
export function middleware() {
|
||||||
import type { NextRequest } from "next/server";
|
return;
|
||||||
|
|
||||||
export function middleware(request: NextRequest) {
|
|
||||||
// For now, just log and continue - auth setup comes later
|
|
||||||
return NextResponse.next();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
matcher: ["/((?!login|verify|api/auth|_next|static|favicon.ico).*)"],
|
matcher: ["/((?!api).*)"],
|
||||||
};
|
};
|
||||||
Loading…
Add table
Reference in a new issue