From 06cd12f0b097ee20a12bf4efaa11df2ad533f147 Mon Sep 17 00:00:00 2001 From: jhansilakshmi27 Date: Wed, 5 Feb 2025 16:53:12 +0530 Subject: [PATCH 1/5] Student Profile page added --- src/components/Common/Navbar.tsx | 9 ++- src/components/Profile/ProfileCard.tsx | 79 ++++++++++++++++++ src/components/Profile/ProfileEditForm.tsx | 94 ++++++++++++++++++++++ src/components/Profile/ProfileHeader.tsx | 16 ++++ src/pages/api/db/profile/getProfile.ts | 19 +++++ src/pages/profile.tsx | 49 +++++++++++ src/types/profileColumnData.ts | 8 ++ 7 files changed, 273 insertions(+), 1 deletion(-) create mode 100644 src/components/Profile/ProfileCard.tsx create mode 100644 src/components/Profile/ProfileEditForm.tsx create mode 100644 src/components/Profile/ProfileHeader.tsx create mode 100644 src/pages/api/db/profile/getProfile.ts create mode 100644 src/pages/profile.tsx create mode 100644 src/types/profileColumnData.ts diff --git a/src/components/Common/Navbar.tsx b/src/components/Common/Navbar.tsx index f7b346a0..2ca60a7e 100644 --- a/src/components/Common/Navbar.tsx +++ b/src/components/Common/Navbar.tsx @@ -6,6 +6,7 @@ import { FiLogOut } from 'react-icons/fi' import { useRouter } from 'next/router' import { useAuth } from '../../contexts/auth' import Image from 'next/image' +import Link from 'next/link' export const Navbar: FC<{}> = ({}) => { const router = useRouter() @@ -33,7 +34,7 @@ export const Navbar: FC<{}> = ({}) => { > user = ({}) => {

Logout

+ {/* Add link to Profile page */} + +

Profile

+
+ + )} diff --git a/src/components/Profile/ProfileCard.tsx b/src/components/Profile/ProfileCard.tsx new file mode 100644 index 00000000..4c78ace0 --- /dev/null +++ b/src/components/Profile/ProfileCard.tsx @@ -0,0 +1,79 @@ +import React from 'react'; +import { ProfileData } from '../../types/profileColumnData'; + +interface ProfileCardProps { + userData: ProfileData; + onEditClick: () => void; +} + +const ProfileCard: React.FC = ({ userData, onEditClick }) => { + return ( +
+ {/* Profile Picture */} +
+ Profile + +
+ + {/* Profile Details */} +
+ {userData.name} + {userData.branch} + {userData.college} +
+ + {/* About Section */} +
+