@@ -6,6 +6,7 @@ import { axiosInstance } from "@/lib/api/axios";
6
6
import { useUserStore } from "@/lib/store" ;
7
7
import Image from "next/image" ;
8
8
import Link from "next/link" ;
9
+ import { useRouter } from "next/navigation" ;
9
10
import {
10
11
SiX ,
11
12
SiInstagram ,
@@ -101,6 +102,7 @@ const MyProfile: React.FC = () => {
101
102
const id = useUserStore ( ( state ) => state . user ?. id ) ;
102
103
const [ isUserModalOpen , setIsUserModalOpen ] = useState ( false ) ;
103
104
const [ isAlumniModalOpen , setIsAlumniModalOpen ] = useState ( false ) ;
105
+ const router = useRouter ( ) ;
104
106
105
107
const { data, error, isLoading } = useQuery < UserProfileData > ( {
106
108
queryKey : [ "myProfile" ] ,
@@ -148,28 +150,35 @@ const MyProfile: React.FC = () => {
148
150
</ div >
149
151
{ /* Username */ }
150
152
< h3 className = "text-3xl font-semibold" > a.k.a. { data ?. username } </ h3 >
151
- { /* Edit Profile Button */ }
152
- < ModalProvider >
153
- < EditUserDetails
154
- userData = { {
155
- id : id || "" ,
156
- name : data . name ,
157
- personalEmail : data . personalEmail ,
158
- username : data . username ,
159
- profiles : data . profiles . map ( ( profile ) => ( {
160
- type : profile . type ,
161
- link : profile . link ,
162
- visibility : profile . visibility === "yes" ,
163
- } ) ) ,
164
- bio : data . bio ,
165
- } }
166
- />
167
- </ ModalProvider >
168
- { data . role === "student" && (
169
- < button className = "px-4 py-2 bg-black text-white rounded-lg" >
170
- Register as Alumni
171
- </ button >
172
- ) }
153
+ { /* Edit Profile Button and Register as alumni Button */ }
154
+ < div className = "flex items-center gap-4" >
155
+ < ModalProvider >
156
+ < EditUserDetails
157
+ userData = { {
158
+ id : id || "" ,
159
+ name : data . name ,
160
+ personalEmail : data . personalEmail ,
161
+ username : data . username ,
162
+ profiles : data . profiles . map ( ( profile ) => ( {
163
+ type : profile . type ,
164
+ link : profile . link ,
165
+ visibility : profile . visibility === "yes" ,
166
+ } ) ) ,
167
+ bio : data . bio ,
168
+ } }
169
+ />
170
+ </ ModalProvider >
171
+
172
+ { data . role === "student" && (
173
+ < button
174
+ className = "bg-blue-500 text-white px-4 py-2 rounded-md"
175
+ onClick = { ( ) => router . push ( "/alumnidetails" ) }
176
+ >
177
+ Register as Alumni
178
+ </ button >
179
+ ) }
180
+ </ div >
181
+
173
182
{ /* Social Media Links */ }
174
183
< div className = "flex space-x-4" >
175
184
{ data ?. profiles &&
0 commit comments