Skip to content

Commit 9a74e7b

Browse files
Add new profile page route
1 parent 352c6a5 commit 9a74e7b

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

app/profile/page.tsx

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
'use client';
2+
import { useUserProfile } from '@/hooks/use-user-profile';
3+
import { ProfileCard } from '@/components/profile/profile-card';
4+
import { ProfileEditor } from '@/components/profile/profile-editor';
5+
import { ArrowLeft } from 'lucide-react';
6+
import { useState, useEffect } from 'react';
7+
import Link from 'next/link';
8+
9+
function ProfilePage() {
10+
const { user, updateProfile } = useUserProfile();
11+
const [isClient, setIsClient] = useState(false);
12+
13+
useEffect(() => {
14+
setIsClient(true);
15+
}, []);
16+
17+
if (!isClient) {
18+
return null;
19+
}
20+
21+
return (
22+
<div className="space-y-4 flex flex-col mx-36 my-12">
23+
<Link href={'/'}>
24+
<ArrowLeft />
25+
</Link>
26+
27+
<ProfileCard user={user} />
28+
<ProfileEditor user={user} onUpdate={updateProfile} />
29+
</div>
30+
);
31+
}
32+
33+
export default ProfilePage;

0 commit comments

Comments
 (0)