diff --git a/src/components/UpdateProfile/UpdateProfileForm.tsx b/src/components/UpdateProfile/UpdateProfileForm.tsx index 016de646c..a8b6bd5b8 100644 --- a/src/components/UpdateProfile/UpdateProfileForm.tsx +++ b/src/components/UpdateProfile/UpdateProfileForm.tsx @@ -2,11 +2,13 @@ import { type FormEvent, useEffect, useState } from 'react'; import { httpGet, httpPost } from '../../lib/http'; import { pageProgressMessage } from '../../stores/page'; import UploadProfilePicture from './UploadProfilePicture'; +import {ArrowDown, ChevronDown} from "lucide-react"; export function UpdateProfileForm() { const [name, setName] = useState(''); const [avatar, setAvatar] = useState(''); const [email, setEmail] = useState(''); + const [username, setUsername] = useState(''); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(''); @@ -50,10 +52,11 @@ export function UpdateProfileForm() { return; } - const { name, email, avatar } = response; + const { name, email, avatar, username } = response; setName(name); setEmail(email); + setUsername(username); setAvatar(avatar || ''); setIsLoading(false); @@ -69,7 +72,7 @@ export function UpdateProfileForm() { return (
-

Profile

+

Basic Information

Update and set up your public profile below.

diff --git a/src/components/UpdateProfile/UpdatePublicProfileForm.tsx b/src/components/UpdateProfile/UpdatePublicProfileForm.tsx index 2450f5cd3..8c0b5040f 100644 --- a/src/components/UpdateProfile/UpdatePublicProfileForm.tsx +++ b/src/components/UpdateProfile/UpdatePublicProfileForm.tsx @@ -8,16 +8,10 @@ import type { UserDocument, } from '../../api/user'; import { SelectionButton } from '../RoadCard/SelectionButton'; -import { - ArrowUpRight, - Check, - Eye, - EyeOff, - Globe, - LockIcon, -} from 'lucide-react'; +import { ArrowUpRight, Eye, EyeOff } from 'lucide-react'; import { useToast } from '../../hooks/use-toast'; import { CreateRoadmapModal } from '../CustomRoadmap/CreateRoadmap/CreateRoadmapModal.tsx'; +import { VisibilityDropdown } from './VisibilityDropdown.tsx'; type RoadmapType = { id: string; @@ -187,52 +181,35 @@ export function UpdatePublicProfileForm() { ); const publicRoadmaps = profileRoadmaps.filter((r) => !r.isCustomResource); - const isAllCustomRoadmapsSelected = - customRoadmaps.length === publicCustomRoadmaps.length || - customRoadmapVisibility === 'all'; - const isAllRoadmapsSelected = - roadmaps.length === publicRoadmaps.length || roadmapVisibility === 'all'; - return ( - <> +
{isCreatingRoadmap && ( setIsCreatingRoadmap(false)} /> )} -
-
-

Public Profile

- {publicProfileUrl && ( - - - Visit Profile - - )} -
- -
- updateProfileVisibility('public')} - /> - updateProfileVisibility('private')} +
+
+

Personal Profile

+ {publicProfileUrl && ( + + + Visit + + )} +
+
-
+

+ Set up your public profile to showcase your learning progress. +

+