Skip to content

Commit 09a8a6d

Browse files
committed
feat: update user profile page title and enable navigation from user cards
1 parent ff9a543 commit 09a8a6d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

web/src/app/(content)/user/[username]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const UserPage = async ({ params }: { params: { username: string } }) => {
2525

2626
if (userData) {
2727
// set the page title to the user's name
28-
document.title = `${userData?.publicName} - User Profile`;
28+
2929
return <UserProfile userData={userData} songData={songData} />;
3030
} else {
3131
return <ErrorBox message='Failed to get user data' />;

web/src/modules/search/components/SearchPageComponent.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ type UserCardProps = {
1515

1616
export const UserCard = ({ user }: UserCardProps) => {
1717
const { id, profileImage, songCount, username } = user;
18-
18+
const router = useRouter();
1919
return (
20-
<div className='max-w-sm p-6 bg-zinc-800 rounded-lg shadow-md hover:bg-zinc-750 transition-colors cursor-pointer'>
20+
<div
21+
className='max-w-sm p-6 bg-zinc-800 rounded-lg shadow-md hover:bg-zinc-750 transition-colors cursor-pointer'
22+
onClick={() => router.push(`/user/${id}`)}
23+
>
2124
{/* Profile Image */}
2225
<div className='flex justify-center'>
2326
<Image

0 commit comments

Comments
 (0)