diff --git a/src/components/UpdateProfile/UpdatePublicProfileForm.tsx b/src/components/UpdateProfile/UpdatePublicProfileForm.tsx index 084c98f76..e81088781 100644 --- a/src/components/UpdateProfile/UpdatePublicProfileForm.tsx +++ b/src/components/UpdateProfile/UpdatePublicProfileForm.tsx @@ -9,8 +9,9 @@ import type { } from '../../api/user'; import { SelectionButton } from '../RoadCard/SelectionButton'; import { - ArrowUpRight, + ArrowUpRight, Check, CheckCircle, + Copy, Eye, EyeOff, FileBadge, @@ -22,6 +23,8 @@ import { VisibilityDropdown } from './VisibilityDropdown.tsx'; import { ProfileUsername } from './ProfileUsername.tsx'; import UploadProfilePicture from './UploadProfilePicture.tsx'; import { SkillProfileAlert } from './SkillProfileAlert.tsx'; +import { useCopyText } from '../../hooks/use-copy-text.ts'; +import { cn } from '../../lib/classname.ts'; type RoadmapType = { id: string; @@ -67,6 +70,8 @@ export function UpdatePublicProfileForm() { const [isLoading, setIsLoading] = useState(false); + const { isCopied, copyText } = useCopyText(); + const handleSubmit = async (e: FormEvent) => { e.preventDefault(); setIsLoading(true); @@ -167,31 +172,6 @@ export function UpdatePublicProfileForm() { setIsLoading(false); }; - const updateProfileVisibility = async ( - visibility: AllowedProfileVisibility, - ) => { - pageProgressMessage.set('Updating profile visibility'); - setIsLoading(true); - - const { error } = await httpPatch( - `${import.meta.env.PUBLIC_API_URL}/v1-update-public-profile-visibility`, - { - profileVisibility: visibility, - }, - ); - - if (error) { - setIsLoading(false); - toast.error(error.message || 'Something went wrong'); - - return; - } - - setProfileVisibility(visibility); - setIsLoading(false); - pageProgressMessage.set(''); - }; - // Make a request to the backend to fill in the form with the current values useEffect(() => { Promise.all([loadProfileSettings(), loadProfileRoadmaps()]).finally(() => { @@ -216,14 +196,31 @@ export function UpdatePublicProfileForm() {

Skill Profile

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