|
| 1 | +import Link from 'next/link'; |
| 2 | + |
| 3 | +export default function AccountPage() { |
| 4 | + const orders = [ |
| 5 | + { id: 'ORD-2024-001', date: 'Jun 15, 2024', items: 3, total: '$469.97', status: 'Delivered' }, |
| 6 | + { id: 'ORD-2024-002', date: 'Jun 2, 2024', items: 1, total: '$89.99', status: 'Delivered' }, |
| 7 | + { id: 'ORD-2024-003', date: 'May 18, 2024', items: 2, total: '$189.98', status: 'Delivered' }, |
| 8 | + { id: 'ORD-2024-004', date: 'May 5, 2024', items: 1, total: '$249.99', status: 'Returned' }, |
| 9 | + ]; |
| 10 | + |
| 11 | + const addresses = [ |
| 12 | + { label: 'Home', name: 'John Doe', address: '123 Main Street, Apt 4B', city: 'New York, NY 10001', default: true }, |
| 13 | + { label: 'Office', name: 'John Doe', address: '456 Business Ave, Floor 12', city: 'New York, NY 10018', default: false }, |
| 14 | + ]; |
| 15 | + |
| 16 | + return ( |
| 17 | + <div className="min-h-screen bg-background"> |
| 18 | + <div className="max-w-5xl mx-auto px-6 py-10"> |
| 19 | + <h1 className="text-3xl font-bold text-foreground mb-2">My Account</h1> |
| 20 | + <p className="text-text-secondary mb-10">Manage your profile, orders, and preferences</p> |
| 21 | + |
| 22 | + <div className="grid grid-cols-1 lg:grid-cols-3 gap-8"> |
| 23 | + {/* Sidebar */} |
| 24 | + <div className="lg:col-span-1"> |
| 25 | + <div className="border border-border rounded-theme bg-card p-6"> |
| 26 | + <div className="flex items-center gap-4 mb-6"> |
| 27 | + <div className="w-14 h-14 rounded-full bg-primary flex items-center justify-center text-white font-bold text-lg"> |
| 28 | + JD |
| 29 | + </div> |
| 30 | + <div> |
| 31 | + <p className="font-semibold text-foreground">John Doe</p> |
| 32 | + <p className="text-sm text-text-secondary">john@example.com</p> |
| 33 | + </div> |
| 34 | + </div> |
| 35 | + <nav> |
| 36 | + <ul className="space-y-1"> |
| 37 | + {['Orders', 'Addresses', 'Payment Methods', 'Wishlist', 'Settings'].map((item, i) => ( |
| 38 | + <li key={item}> |
| 39 | + <button className={`w-full text-left px-4 py-2.5 rounded-theme text-sm transition ${i === 0 ? 'bg-primary text-white font-medium' : 'text-text-secondary hover:bg-bg-secondary hover:text-foreground'}`}> |
| 40 | + {item} |
| 41 | + </button> |
| 42 | + </li> |
| 43 | + ))} |
| 44 | + </ul> |
| 45 | + </nav> |
| 46 | + <button className="mt-6 w-full py-2 text-sm text-text-secondary border border-border rounded-theme hover:bg-bg-secondary transition"> |
| 47 | + Sign Out |
| 48 | + </button> |
| 49 | + </div> |
| 50 | + </div> |
| 51 | + |
| 52 | + {/* Main Content */} |
| 53 | + <div className="lg:col-span-2 space-y-8"> |
| 54 | + {/* Recent Orders */} |
| 55 | + <div className="border border-border rounded-theme bg-card"> |
| 56 | + <div className="px-6 py-4 border-b border-border flex items-center justify-between"> |
| 57 | + <h2 className="text-lg font-semibold text-foreground">Recent Orders</h2> |
| 58 | + <button className="text-sm text-primary hover:underline">View All</button> |
| 59 | + </div> |
| 60 | + <div className="divide-y divide-border"> |
| 61 | + {orders.map((order) => ( |
| 62 | + <div key={order.id} className="px-6 py-4 flex items-center justify-between"> |
| 63 | + <div> |
| 64 | + <p className="text-sm font-medium text-foreground">{order.id}</p> |
| 65 | + <p className="text-xs text-text-secondary mt-0.5">{order.date} · {order.items} item{order.items > 1 ? 's' : ''}</p> |
| 66 | + </div> |
| 67 | + <div className="text-right"> |
| 68 | + <p className="text-sm font-semibold text-foreground">{order.total}</p> |
| 69 | + <span className={`inline-flex px-2 py-0.5 text-xs font-medium rounded-full mt-1 ${ |
| 70 | + order.status === 'Delivered' ? 'bg-green-100 text-green-700' : 'bg-yellow-100 text-yellow-700' |
| 71 | + }`}> |
| 72 | + {order.status} |
| 73 | + </span> |
| 74 | + </div> |
| 75 | + </div> |
| 76 | + ))} |
| 77 | + </div> |
| 78 | + </div> |
| 79 | + |
| 80 | + {/* Saved Addresses */} |
| 81 | + <div className="border border-border rounded-theme bg-card"> |
| 82 | + <div className="px-6 py-4 border-b border-border flex items-center justify-between"> |
| 83 | + <h2 className="text-lg font-semibold text-foreground">Saved Addresses</h2> |
| 84 | + <button className="text-sm text-primary hover:underline">Add New</button> |
| 85 | + </div> |
| 86 | + <div className="p-6 grid grid-cols-1 sm:grid-cols-2 gap-4"> |
| 87 | + {addresses.map((addr) => ( |
| 88 | + <div key={addr.label} className={`border rounded-theme p-4 ${addr.default ? 'border-primary' : 'border-border'}`}> |
| 89 | + <div className="flex items-center justify-between mb-2"> |
| 90 | + <span className="text-sm font-semibold text-foreground">{addr.label}</span> |
| 91 | + {addr.default && ( |
| 92 | + <span className="px-2 py-0.5 text-xs font-medium rounded-full bg-primary/10 text-primary">Default</span> |
| 93 | + )} |
| 94 | + </div> |
| 95 | + <p className="text-sm text-foreground">{addr.name}</p> |
| 96 | + <p className="text-sm text-text-secondary">{addr.address}</p> |
| 97 | + <p className="text-sm text-text-secondary">{addr.city}</p> |
| 98 | + <div className="mt-3 flex gap-3"> |
| 99 | + <button className="text-xs text-primary hover:underline">Edit</button> |
| 100 | + <button className="text-xs text-text-secondary hover:text-red-500">Remove</button> |
| 101 | + </div> |
| 102 | + </div> |
| 103 | + ))} |
| 104 | + </div> |
| 105 | + </div> |
| 106 | + |
| 107 | + {/* Account Settings */} |
| 108 | + <div className="border border-border rounded-theme bg-card p-6"> |
| 109 | + <h2 className="text-lg font-semibold text-foreground mb-6">Account Settings</h2> |
| 110 | + <div className="grid grid-cols-1 sm:grid-cols-2 gap-4"> |
| 111 | + <div> |
| 112 | + <label className="block text-sm font-medium text-foreground mb-1.5">First Name</label> |
| 113 | + <input type="text" defaultValue="John" className="w-full px-4 py-2.5 rounded-theme border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary" /> |
| 114 | + </div> |
| 115 | + <div> |
| 116 | + <label className="block text-sm font-medium text-foreground mb-1.5">Last Name</label> |
| 117 | + <input type="text" defaultValue="Doe" className="w-full px-4 py-2.5 rounded-theme border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary" /> |
| 118 | + </div> |
| 119 | + <div> |
| 120 | + <label className="block text-sm font-medium text-foreground mb-1.5">Email</label> |
| 121 | + <input type="email" defaultValue="john@example.com" className="w-full px-4 py-2.5 rounded-theme border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary" /> |
| 122 | + </div> |
| 123 | + <div> |
| 124 | + <label className="block text-sm font-medium text-foreground mb-1.5">Phone</label> |
| 125 | + <input type="tel" defaultValue="+1 (555) 123-4567" className="w-full px-4 py-2.5 rounded-theme border border-border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary" /> |
| 126 | + </div> |
| 127 | + </div> |
| 128 | + <button className="mt-6 px-6 py-2.5 rounded-theme bg-primary text-white font-medium hover:bg-primary-hover transition"> |
| 129 | + Save Changes |
| 130 | + </button> |
| 131 | + </div> |
| 132 | + </div> |
| 133 | + </div> |
| 134 | + </div> |
| 135 | + </div> |
| 136 | + ); |
| 137 | +} |
0 commit comments