This commit is contained in:
Emma781227
2026-06-26 11:26:45 +02:00
parent 1cf2a24ede
commit 2d25c91c55
14 changed files with 540 additions and 165 deletions

View File

@@ -1,41 +1,7 @@
import { Link } from 'react-router-dom'
function TabNav({ active }) {
return (
<div className="flex border-b border-gray-200 mb-6">
<Link
to="/mes-gains"
className={`flex-1 flex items-center justify-center gap-2 py-3 text-sm font-medium transition-colors ${
active === 'gains'
? 'text-[#006B6B] border-b-2 border-[#006B6B]'
: 'text-gray-400'
}`}
>
<svg className="w-4 h-4" fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" d="M20 12V22H4V12M22 7H2v5h20V7zM12 22V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z" />
</svg>
Mes gains
</Link>
<Link
to="/profile"
className={`flex-1 flex items-center justify-center gap-2 py-3 text-sm font-medium transition-colors ${
active === 'profile'
? 'text-[#006B6B] border-b-2 border-[#006B6B]'
: 'text-gray-400'
}`}
>
<svg className="w-4 h-4" fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
</svg>
Profile
</Link>
</div>
)
}
import UserNav from '../components/UserNav'
export default function Profile() {
const user = JSON.parse(localStorage.getItem('user') || '{}')
const initials = `${(user.firstname || '?')[0]}${(user.lastname || '?')[0]}`.toUpperCase()
const handleSubmit = (e) => {
@@ -46,9 +12,8 @@ export default function Profile() {
return (
<div className="min-h-screen bg-white max-w-sm mx-auto px-6 pt-6">
<TabNav active="profile" />
<UserNav active="profile" />
{/* Avatar */}
<div className="mb-6">
<div className="w-14 h-14 rounded-full bg-[#006B6B] flex items-center justify-center text-white text-lg font-bold">
{initials}
@@ -62,21 +27,18 @@ export default function Profile() {
{user.email || '—'}
</div>
</div>
<div>
<label className="block text-sm font-medium text-gray-800 mb-1">Nom</label>
<div className="w-full border border-gray-200 rounded-lg px-4 py-3 text-sm text-gray-700 bg-gray-50">
{user.lastname || '—'}
</div>
</div>
<div>
<label className="block text-sm font-medium text-gray-800 mb-1">Prénom</label>
<div className="w-full border border-gray-200 rounded-lg px-4 py-3 text-sm text-gray-700 bg-gray-50">
{user.firstname || '—'}
</div>
</div>
<button
type="submit"
className="w-full bg-[#006B6B] hover:bg-[#005959] text-white font-medium py-3 rounded-lg transition-colors"