Add Profile, Family, Notifications pages
This commit is contained in:
parent
6a6a0e91da
commit
03a5e3f3e9
3 changed files with 179 additions and 0 deletions
57
src/app/family/page.tsx
Normal file
57
src/app/family/page.tsx
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useState } from "react";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
|
interface FamilyMember {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
role: string;
|
||||||
|
avatar: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function FamilyPage() {
|
||||||
|
const router = useRouter();
|
||||||
|
const [members] = useState<FamilyMember[]>([
|
||||||
|
{ id: "1", name: "You", role: "Parent", avatar: "👤" },
|
||||||
|
{ id: "2", name: "Baby Tia", role: "Child", avatar: "👶" },
|
||||||
|
]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen bg-gradient-to-br from-rose-50 to-amber-50 dark:from-gray-900 dark:to-gray-800">
|
||||||
|
<div className="p-4 flex items-center gap-4">
|
||||||
|
<button onClick={() => router.back()} className="p-2">←</button>
|
||||||
|
<h1 className="text-xl font-bold">Family</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="px-4 space-y-4">
|
||||||
|
{/* Members List */}
|
||||||
|
<div className="space-y-2">
|
||||||
|
<div className="text-sm text-gray-500 mb-2">Family Members</div>
|
||||||
|
{members.map((member) => (
|
||||||
|
<div key={member.id} className="flex items-center gap-4 p-4 bg-white dark:bg-gray-800 rounded-xl">
|
||||||
|
<div className="text-3xl">{member.avatar}</div>
|
||||||
|
<div className="flex-1">
|
||||||
|
<div className="font-medium">{member.name}</div>
|
||||||
|
<div className="text-sm text-gray-500">{member.role}</div>
|
||||||
|
</div>
|
||||||
|
<button className="text-gray-400">✏️</button>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Add Member */}
|
||||||
|
<button className="w-full p-4 border-2 border-dashed border-gray-300 rounded-xl text-gray-500">
|
||||||
|
+ Add Family Member
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{/* Quick Info */}
|
||||||
|
<div className="p-4 bg-white dark:bg-gray-800 rounded-xl mt-6">
|
||||||
|
<div className="text-sm text-gray-500 mb-2">Family Plan</div>
|
||||||
|
<div className="font-medium">Up to 4 family members</div>
|
||||||
|
<div className="text-sm text-gray-500 mt-1">Free for now</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
60
src/app/notifications/page.tsx
Normal file
60
src/app/notifications/page.tsx
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useState } from "react";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
|
interface Notification {
|
||||||
|
id: string;
|
||||||
|
title: string;
|
||||||
|
message: string;
|
||||||
|
time: string;
|
||||||
|
read: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function NotificationsPage() {
|
||||||
|
const router = useRouter();
|
||||||
|
const [notifications] = useState<Notification[]>([
|
||||||
|
{ id: "1", title: "Reminder", message: "Time to log today's feed", time: "2 hours ago", read: false },
|
||||||
|
{ id: "2", title: "Growth Update", message: "New growth data saved", time: "Yesterday", read: true },
|
||||||
|
]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen bg-gradient-to-br from-rose-50 to-amber-50 dark:from-gray-900 dark:to-gray-800">
|
||||||
|
<div className="p-4 flex items-center gap-4">
|
||||||
|
<button onClick={() => router.back()} className="p-2">←</button>
|
||||||
|
<h1 className="text-xl font-bold">Notifications</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="px-4 space-y-2">
|
||||||
|
{notifications.length === 0 ? (
|
||||||
|
<div className="text-center py-20 text-gray-400">
|
||||||
|
<div className="text-6xl mb-4">🔔</div>
|
||||||
|
<p>No notifications</p>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
notifications.map((notif) => (
|
||||||
|
<div
|
||||||
|
key={notif.id}
|
||||||
|
className={`p-4 rounded-xl ${notif.read ? "bg-gray-50 dark:bg-gray-800" : "bg-white dark:bg-gray-700"}`}
|
||||||
|
>
|
||||||
|
<div className="flex items-start justify-between">
|
||||||
|
<div className="flex-1">
|
||||||
|
<div className="font-medium">{notif.title}</div>
|
||||||
|
<div className="text-sm text-gray-500">{notif.message}</div>
|
||||||
|
<div className="text-xs text-gray-400 mt-1">{notif.time}</div>
|
||||||
|
</div>
|
||||||
|
{!notif.read && <div className="w-2 h-2 bg-rose-400 rounded-full mt-2" />}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{notifications.length > 0 && (
|
||||||
|
<div className="px-4 mt-6">
|
||||||
|
<button className="text-sm text-gray-500">Mark all as read</button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
62
src/app/profile/page.tsx
Normal file
62
src/app/profile/page.tsx
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useState } from "react";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
|
export default function ProfilePage() {
|
||||||
|
const router = useRouter();
|
||||||
|
const [name, setName] = useState("Parent");
|
||||||
|
const [email, setEmail] = useState("parent@example.com");
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen bg-gradient-to-br from-rose-50 to-amber-50 dark:from-gray-900 dark:to-gray-800">
|
||||||
|
<div className="p-4 flex items-center gap-4">
|
||||||
|
<button onClick={() => router.back()} className="p-2">←</button>
|
||||||
|
<h1 className="text-xl font-bold">Profile</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="px-4 space-y-4">
|
||||||
|
{/* Avatar */}
|
||||||
|
<div className="flex flex-col items-center py-8">
|
||||||
|
<div className="w-24 h-24 bg-rose-100 rounded-full flex items-center justify-center text-4xl mb-4">
|
||||||
|
👤
|
||||||
|
</div>
|
||||||
|
<button className="text-rose-500 text-sm">Change Photo</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Form */}
|
||||||
|
<div className="space-y-3">
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium mb-1">Name</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
value={name}
|
||||||
|
onChange={(e) => setName(e.target.value)}
|
||||||
|
className="w-full p-3 bg-white dark:bg-gray-800 rounded-xl border"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="block text-sm font-medium mb-1">Email</label>
|
||||||
|
<input
|
||||||
|
type="email"
|
||||||
|
value={email}
|
||||||
|
onChange={(e) => setEmail(e.target.value)}
|
||||||
|
className="w-full p-3 bg-white dark:bg-gray-800 rounded-xl border"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button className="w-full p-3 bg-rose-400 text-white rounded-xl mt-4">
|
||||||
|
Save Changes
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Account Info */}
|
||||||
|
<div className="p-4 bg-white dark:bg-gray-800 rounded-xl mt-6">
|
||||||
|
<div className="font-medium mb-2">Account</div>
|
||||||
|
<div className="text-sm text-gray-500">Member since: Jan 2024</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue