-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ca16a1
commit d90add4
Showing
5 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
|
||
export const metadata = { | ||
title: 'User Profile', | ||
description: 'View and edit your user profile', | ||
}; | ||
|
||
interface ProfileLayoutProps { | ||
children: React.ReactNode; | ||
} | ||
|
||
export default function ProfileLayout({ children }: ProfileLayoutProps) { | ||
return ( | ||
<div className="max-w-4xl mx-auto p-4"> | ||
<h1 className="text-2xl font-bold mb-4">User Profile</h1> | ||
<div className="bg-white shadow-md rounded-lg p-4">{children}</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use client'; | ||
|
||
import React, { useEffect } from 'react'; | ||
import { useRouter } from 'next/navigation'; | ||
import { useAuth } from '@/hooks/useAuth'; | ||
import { UserProfileContainer } from '@/components/containers/UserProfileContainer'; | ||
|
||
export default function ProfilePage() { | ||
const { user, isAuthenticated } = useAuth(); | ||
|
||
const router = useRouter(); | ||
|
||
useEffect(() => { | ||
if (!isAuthenticated) { | ||
router.push('/auth'); | ||
} | ||
}, [isAuthenticated, router]); | ||
|
||
if (!user) { | ||
return <p className="text-red-500">User not found. Please log in.</p>; | ||
} | ||
|
||
return <UserProfileContainer userId={user.userId} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters