Refactor public profile form

pull/5494/head
Kamran Ahmed 8 months ago
parent 7600b1af89
commit b2b5bfc8a1
  1. 30
      src/components/UpdateProfile/UpdatePublicProfileForm.tsx

@ -8,7 +8,14 @@ import type {
UserDocument, UserDocument,
} from '../../api/user'; } from '../../api/user';
import { SelectionButton } from '../RoadCard/SelectionButton'; import { SelectionButton } from '../RoadCard/SelectionButton';
import { ArrowUpRight, Globe, LockIcon } from 'lucide-react'; import {
ArrowUpRight,
Check,
Eye,
EyeOff,
Globe,
LockIcon,
} from 'lucide-react';
import { useToast } from '../../hooks/use-toast'; import { useToast } from '../../hooks/use-toast';
import { CreateRoadmapModal } from '../CustomRoadmap/CreateRoadmap/CreateRoadmapModal.tsx'; import { CreateRoadmapModal } from '../CustomRoadmap/CreateRoadmap/CreateRoadmapModal.tsx';
@ -271,12 +278,13 @@ export function UpdatePublicProfileForm() {
<div className="rounded-md border p-4"> <div className="rounded-md border p-4">
<h3 className="text-sm font-medium"> <h3 className="text-sm font-medium">
Pick the roadmaps to show your progress Which roadmap progresses do you want to show on your profile?
</h3> </h3>
<div className="mt-3 flex items-center gap-2"> <div className="mt-3 flex items-center gap-2">
<SelectionButton <SelectionButton
type="button" type="button"
text="All Roadmaps" text="All Progress"
icon={Eye}
isDisabled={false} isDisabled={false}
isSelected={roadmapVisibility === 'all'} isSelected={roadmapVisibility === 'all'}
onClick={() => { onClick={() => {
@ -286,6 +294,7 @@ export function UpdatePublicProfileForm() {
/> />
<SelectionButton <SelectionButton
type="button" type="button"
icon={EyeOff}
text="Hide my Progress" text="Hide my Progress"
isDisabled={false} isDisabled={false}
isSelected={roadmapVisibility === 'none'} isSelected={roadmapVisibility === 'none'}
@ -296,8 +305,8 @@ export function UpdatePublicProfileForm() {
/> />
</div> </div>
<h3 className="mt-4 text-sm font-medium"> <h3 className="mt-4 text-sm text-gray-400">
Only show the selected roadmaps Or select the roadmaps you want to show
</h3> </h3>
{publicRoadmaps.length > 0 ? ( {publicRoadmaps.length > 0 ? (
<div className="mt-3 flex flex-wrap items-center gap-2"> <div className="mt-3 flex flex-wrap items-center gap-2">
@ -339,12 +348,13 @@ export function UpdatePublicProfileForm() {
<div className="rounded-md border p-4"> <div className="rounded-md border p-4">
<h3 className="text-sm font-medium"> <h3 className="text-sm font-medium">
Pick the custom roadmaps to show on your profile Pick your custom roadmaps to show on your profile
</h3> </h3>
<div className="mt-3 flex items-center gap-2"> <div className="mt-3 flex items-center gap-2">
<SelectionButton <SelectionButton
type="button" type="button"
text="All Roadmaps" text="All Roadmaps"
icon={Eye}
isDisabled={false} isDisabled={false}
isSelected={customRoadmapVisibility === 'all'} isSelected={customRoadmapVisibility === 'all'}
onClick={() => { onClick={() => {
@ -355,6 +365,7 @@ export function UpdatePublicProfileForm() {
<SelectionButton <SelectionButton
type="button" type="button"
text="Hide my Custom Roadmaps" text="Hide my Custom Roadmaps"
icon={EyeOff}
isDisabled={false} isDisabled={false}
isSelected={customRoadmapVisibility === 'none'} isSelected={customRoadmapVisibility === 'none'}
onClick={() => { onClick={() => {
@ -364,8 +375,8 @@ export function UpdatePublicProfileForm() {
/> />
</div> </div>
<h3 className="mt-4 text-sm font-medium"> <h3 className="mt-4 text-sm text-gray-400">
Only show the following selected custom roadmaps Or select the custom roadmaps you want to show
</h3> </h3>
{publicCustomRoadmaps.length > 0 ? ( {publicCustomRoadmaps.length > 0 ? (
<div className="mt-3 flex flex-wrap items-center gap-2"> <div className="mt-3 flex flex-wrap items-center gap-2">
@ -508,8 +519,7 @@ export function UpdatePublicProfileForm() {
</div> </div>
{isAvailableForHire && ( {isAvailableForHire && (
<p className="mt-1 text-sm text-slate-500"> <p className="mt-1 text-sm text-slate-500">
Make sure to keep your progress updated for Make sure to keep your progress updated for potential employers.
potential employers.
</p> </p>
)} )}
</div> </div>

Loading…
Cancel
Save