@@ -36,6 +36,7 @@ import { Separator } from "@/components/ui/separator";
3636import { Textarea } from "@/components/ui/textarea" ;
3737import { ActivityHeatmap } from "./activity-heatmap" ;
3838import { SocialConnectionButton } from "./social-connection-button" ;
39+ import { useOpenPath } from "@/hooks/use-open-path" ;
3940
4041const profileFormSchema = z . object ( {
4142 displayName : z . string ( ) . min ( 2 , {
@@ -92,6 +93,7 @@ const defaultValues: Partial<ProfileFormValues> = {
9293
9394export default function Profile ( ) {
9495 const [ isEditing , setIsEditing ] = useState ( false ) ;
96+ const { openPath } = useOpenPath ( ) ;
9597
9698 const form = useForm < ProfileFormValues > ( {
9799 resolver : zodResolver ( profileFormSchema ) ,
@@ -392,50 +394,44 @@ export default function Profile() {
392394 < div className = "flex items-center gap-2" >
393395 < ExternalLink className = "text-muted-foreground h-4 w-4" />
394396 < span className = "text-sm font-medium" > Website:</ span >
395- < a
396- href = { defaultValues . website }
397- target = "_blank"
398- rel = "noopener noreferrer"
397+ < button
398+ onClick = { ( ) => openPath ( defaultValues . website ! ) }
399399 className = "text-primary text-sm hover:underline"
400400 >
401401 { defaultValues . website . replace ( / ^ h t t p s ? : \/ \/ / , "" ) }
402- </ a >
402+ </ button >
403403 </ div >
404404 ) }
405405
406406 { defaultValues . xLink && (
407407 < div className = "flex items-center gap-2" >
408408 < Twitter className = "text-muted-foreground h-4 w-4" />
409409 < span className = "text-sm font-medium" > X:</ span >
410- < a
411- href = { defaultValues . xLink }
412- target = "_blank"
413- rel = "noopener noreferrer"
410+ < button
411+ onClick = { ( ) => openPath ( defaultValues . xLink ! ) }
414412 className = "text-primary text-sm hover:underline"
415413 >
416414 { defaultValues . xLink . replace (
417415 / ^ h t t p s ? : \/ \/ ( w w w \. ) ? x \. c o m \/ / ,
418416 "@" ,
419417 ) }
420- </ a >
418+ </ button >
421419 </ div >
422420 ) }
423421
424422 { defaultValues . linkedinLink && (
425423 < div className = "flex items-center gap-2" >
426424 < Linkedin className = "text-muted-foreground h-4 w-4" />
427425 < span className = "text-sm font-medium" > LinkedIn:</ span >
428- < a
429- href = { defaultValues . linkedinLink }
430- target = "_blank"
431- rel = "noopener noreferrer"
426+ < button
427+ onClick = { ( ) => openPath ( defaultValues . linkedinLink ! ) }
432428 className = "text-primary text-sm hover:underline"
433429 >
434430 { defaultValues . linkedinLink . replace (
435431 / ^ h t t p s ? : \/ \/ ( w w w \. ) ? l i n k e d i n \. c o m \/ i n \/ / ,
436432 "" ,
437433 ) }
438- </ a >
434+ </ button >
439435 </ div >
440436 ) }
441437 </ div >
0 commit comments