diff --git a/apps/hackathon/public/images/banner-imphnen.png b/apps/hackathon/public/images/banner-imphnen.png new file mode 100644 index 0000000..b6a6cf8 Binary files /dev/null and b/apps/hackathon/public/images/banner-imphnen.png differ diff --git a/apps/hackathon/src/app/dashboard/page.tsx b/apps/hackathon/src/app/dashboard/page.tsx index 45250f7..85d9edd 100644 --- a/apps/hackathon/src/app/dashboard/page.tsx +++ b/apps/hackathon/src/app/dashboard/page.tsx @@ -73,61 +73,62 @@ const DashboardPage: FC = (): ReactElement => { )} {myTeams.length > 0 ? ( -
-

My Team

-
+
+

My Team

+
{myTeams.map((team) => ( {team.banner && {team.name}} -
-
- {team.logo && {team.name}} +
+
+ {team.logo && {team.name}}
-

{team.name}

-

City: {team.city}

+

{team.name}

+

City: {team.city}

-

{team.description}

+

{team.description}

))}
) : ( -
+
-
Wave
-

You are not in a team yet

-

Use the sidebar to browse teams or create your own

+
👋
+

You are not in a team yet

+

Use the sidebar to browse teams or create your own

)}
-
-
- {user?.avatar ? ( - {user.fullname - ) : ( -
- User -
- )} -
- {/* User Name and Edit profile button in one line */} -
-

{user?.fullname || user?.email?.split('@')[0] || 'Unnamed User'}

- Edit Profile -
- {user?.location ? ( -

{user.location}

+
+
+
+ {user?.avatar ? ( + {user.fullname ) : ( - Complete your profile +
+ User +
)} +
+

{user?.fullname || user?.email?.split('@')[0] || 'Unnamed User'}

+ {user?.location ? ( +

{user.location}

+ ) : ( + Complete your profile + )} +
+ {user?.location && ( + Edit Profile + )}
-
+
{user?.bio && (

About

diff --git a/apps/hackathon/src/app/profile/page.tsx b/apps/hackathon/src/app/profile/page.tsx index 7e07f3b..0163665 100644 --- a/apps/hackathon/src/app/profile/page.tsx +++ b/apps/hackathon/src/app/profile/page.tsx @@ -1,8 +1,8 @@ import { FC, ReactElement, useState, useEffect } from 'react'; import { ControlledInputField } from '@imphnen-frontend-service/ui/organisms'; -import { Button } from '@imphnen-frontend-service/ui/atoms'; +import { Button, Textarea } from '@imphnen-frontend-service/ui/atoms'; import { useNavigate, Link } from 'react-router'; -import { useForm } from 'react-hook-form'; +import { useForm, Controller } from 'react-hook-form'; import { userEditProfileSchema, TUserEditProfileForm, @@ -12,6 +12,18 @@ import { } from '@imphnen-frontend-service/service'; import { zodResolver } from '@hookform/resolvers/zod'; import { toast } from 'sonner'; +import { CitySelect } from '../../components/city-select'; + +const ROLE_OPTIONS = [ + 'Frontend Developer', + 'Backend Developer', + 'Full Stack Developer', + 'DevOps Engineer', + 'UI/UX Designer', + 'Product Manager', + 'Data Scientist', + 'Mobile Developer', +]; const ProfilePage: FC = (): ReactElement => { const navigate = useNavigate(); @@ -28,6 +40,9 @@ const ProfilePage: FC = (): ReactElement => { defaultValues: { fullname: session?.user?.fullname || '', avatar: session?.user?.avatar || null, + location: session?.user?.location || '', + bio: session?.user?.bio || '', + skills: session?.user?.skills || [], }, }); @@ -39,7 +54,16 @@ const ProfilePage: FC = (): ReactElement => { if (session?.user?.fullname) { form.setValue('fullname', session.user.fullname); } - }, [session?.user?.avatar, session?.user?.fullname, avatarPreview, form]); + if (session?.user?.location) { + form.setValue('location', session.user.location); + } + if (session?.user?.bio) { + form.setValue('bio', session.user.bio); + } + if (session?.user?.skills) { + form.setValue('skills', session.user.skills); + } + }, [session?.user?.avatar, session?.user?.fullname, session?.user?.location, session?.user?.bio, session?.user?.skills, avatarPreview, form]); const handleAvatarChange = (e: React.ChangeEvent) => { const file = e.target.files?.[0]; @@ -79,6 +103,9 @@ const ProfilePage: FC = (): ReactElement => { await updateUser({ fullname: data.fullname, avatar: avatarUrl, + location: data.location, + bio: data.bio, + skills: data.skills, }); toast.success('Profile updated successfully!'); @@ -192,6 +219,87 @@ const ProfilePage: FC = (): ReactElement => { name="fullname" /> + {/* City */} +
+ + ( + + )} + /> +
+ + {/* Role/Skills */} +
+ + ( +
+
+ {ROLE_OPTIONS.map((role) => ( + + ))} +
+
+ )} + /> +
+ + {/* Bio */} +
+ + ( +
+