|
|
@ -8,8 +8,9 @@ import type { |
|
|
|
UserDocument, |
|
|
|
UserDocument, |
|
|
|
} from '../../api/user'; |
|
|
|
} from '../../api/user'; |
|
|
|
import { SelectionButton } from '../RoadCard/SelectionButton'; |
|
|
|
import { SelectionButton } from '../RoadCard/SelectionButton'; |
|
|
|
import { ArrowUpRight } from 'lucide-react'; |
|
|
|
import { ArrowUpRight, Globe, LockIcon } from 'lucide-react'; |
|
|
|
import { useToast } from '../../hooks/use-toast'; |
|
|
|
import { useToast } from '../../hooks/use-toast'; |
|
|
|
|
|
|
|
import { CreateRoadmapModal } from '../CustomRoadmap/CreateRoadmap/CreateRoadmapModal.tsx'; |
|
|
|
|
|
|
|
|
|
|
|
type RoadmapType = { |
|
|
|
type RoadmapType = { |
|
|
|
id: string; |
|
|
|
id: string; |
|
|
@ -28,6 +29,7 @@ export function UpdatePublicProfileForm() { |
|
|
|
|
|
|
|
|
|
|
|
const toast = useToast(); |
|
|
|
const toast = useToast(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [isCreatingRoadmap, setIsCreatingRoadmap] = useState(false); |
|
|
|
const [publicProfileUrl, setPublicProfileUrl] = useState(''); |
|
|
|
const [publicProfileUrl, setPublicProfileUrl] = useState(''); |
|
|
|
const [isAvailableForHire, setIsAvailableForHire] = useState(false); |
|
|
|
const [isAvailableForHire, setIsAvailableForHire] = useState(false); |
|
|
|
const [isEmailVisible, setIsEmailVisible] = useState(true); |
|
|
|
const [isEmailVisible, setIsEmailVisible] = useState(true); |
|
|
@ -186,6 +188,10 @@ export function UpdatePublicProfileForm() { |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
|
|
|
|
{isCreatingRoadmap && ( |
|
|
|
|
|
|
|
<CreateRoadmapModal onClose={() => setIsCreatingRoadmap(false)} /> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
|
|
|
|
<div className="mt-10 flex items-center justify-between gap-2"> |
|
|
|
<div className="mt-10 flex items-center justify-between gap-2"> |
|
|
|
<div className="flex items-center gap-2"> |
|
|
|
<div className="flex items-center gap-2"> |
|
|
|
<h3 className="text-2xl font-bold">Public Profile</h3> |
|
|
|
<h3 className="text-2xl font-bold">Public Profile</h3> |
|
|
@ -200,6 +206,7 @@ export function UpdatePublicProfileForm() { |
|
|
|
<SelectionButton |
|
|
|
<SelectionButton |
|
|
|
type="button" |
|
|
|
type="button" |
|
|
|
text="Public" |
|
|
|
text="Public" |
|
|
|
|
|
|
|
icon={Globe} |
|
|
|
isDisabled={profileVisibility === 'public'} |
|
|
|
isDisabled={profileVisibility === 'public'} |
|
|
|
isSelected={profileVisibility === 'public'} |
|
|
|
isSelected={profileVisibility === 'public'} |
|
|
|
onClick={() => updateProfileVisibility('public')} |
|
|
|
onClick={() => updateProfileVisibility('public')} |
|
|
@ -207,6 +214,7 @@ export function UpdatePublicProfileForm() { |
|
|
|
<SelectionButton |
|
|
|
<SelectionButton |
|
|
|
type="button" |
|
|
|
type="button" |
|
|
|
text="Private" |
|
|
|
text="Private" |
|
|
|
|
|
|
|
icon={LockIcon} |
|
|
|
isDisabled={profileVisibility === 'private'} |
|
|
|
isDisabled={profileVisibility === 'private'} |
|
|
|
isSelected={profileVisibility === 'private'} |
|
|
|
isSelected={profileVisibility === 'private'} |
|
|
|
onClick={() => updateProfileVisibility('private')} |
|
|
|
onClick={() => updateProfileVisibility('private')} |
|
|
@ -262,7 +270,9 @@ export function UpdatePublicProfileForm() { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div className="rounded-md border p-4"> |
|
|
|
<div className="rounded-md border p-4"> |
|
|
|
<h3 className="text-sm font-medium">Show my Learning Activity</h3> |
|
|
|
<h3 className="text-sm font-medium"> |
|
|
|
|
|
|
|
Pick the roadmaps to show your progress |
|
|
|
|
|
|
|
</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" |
|
|
@ -276,7 +286,7 @@ export function UpdatePublicProfileForm() { |
|
|
|
/> |
|
|
|
/> |
|
|
|
<SelectionButton |
|
|
|
<SelectionButton |
|
|
|
type="button" |
|
|
|
type="button" |
|
|
|
text="Hide my Activity" |
|
|
|
text="Hide my Progress" |
|
|
|
isDisabled={false} |
|
|
|
isDisabled={false} |
|
|
|
isSelected={roadmapVisibility === 'none'} |
|
|
|
isSelected={roadmapVisibility === 'none'} |
|
|
|
onClick={() => { |
|
|
|
onClick={() => { |
|
|
@ -286,7 +296,9 @@ export function UpdatePublicProfileForm() { |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<h3 className="mt-4 text-sm font-medium">Only Following Roadmaps</h3> |
|
|
|
<h3 className="mt-4 text-sm font-medium"> |
|
|
|
|
|
|
|
Only show the selected roadmaps |
|
|
|
|
|
|
|
</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"> |
|
|
|
{publicRoadmaps.map((r) => ( |
|
|
|
{publicRoadmaps.map((r) => ( |
|
|
@ -326,7 +338,9 @@ export function UpdatePublicProfileForm() { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div className="rounded-md border p-4"> |
|
|
|
<div className="rounded-md border p-4"> |
|
|
|
<h3 className="text-sm font-medium">Show my Custom Roadmaps</h3> |
|
|
|
<h3 className="text-sm font-medium"> |
|
|
|
|
|
|
|
Pick the custom roadmaps to show on your profile |
|
|
|
|
|
|
|
</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" |
|
|
@ -350,7 +364,9 @@ export function UpdatePublicProfileForm() { |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<h3 className="mt-4 text-sm font-medium">Only Following Roadmaps</h3> |
|
|
|
<h3 className="mt-4 text-sm font-medium"> |
|
|
|
|
|
|
|
Only show the following selected custom roadmaps |
|
|
|
|
|
|
|
</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"> |
|
|
|
{publicCustomRoadmaps.map((r) => ( |
|
|
|
{publicCustomRoadmaps.map((r) => ( |
|
|
@ -377,11 +393,18 @@ export function UpdatePublicProfileForm() { |
|
|
|
))} |
|
|
|
))} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<p className="mt-2 rounded-lg bg-yellow-100 p-2 text-yellow-700"> |
|
|
|
<p className="mt-2 rounded-lg bg-yellow-100 p-2 text-sm text-yellow-700"> |
|
|
|
You have not created any custom roadmaps yet.{' '} |
|
|
|
You do not have any custom roadmaps.{' '} |
|
|
|
<a href="/roadmaps" className="text-black underline"> |
|
|
|
<button |
|
|
|
Create a custom roadmap |
|
|
|
type={'button'} |
|
|
|
</a> |
|
|
|
className="font-medium underline underline-offset-2 hover:text-yellow-800" |
|
|
|
|
|
|
|
onClick={() => { |
|
|
|
|
|
|
|
setIsCreatingRoadmap(true); |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
Create one now |
|
|
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
. |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
)} |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -471,7 +494,7 @@ export function UpdatePublicProfileForm() { |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div className="flex items-center gap-2"> |
|
|
|
<div className="flex select-none items-center gap-2"> |
|
|
|
<input |
|
|
|
<input |
|
|
|
type="checkbox" |
|
|
|
type="checkbox" |
|
|
|
name="isAvailableForHire" |
|
|
|
name="isAvailableForHire" |
|
|
@ -483,10 +506,12 @@ export function UpdatePublicProfileForm() { |
|
|
|
Available for Hire |
|
|
|
Available for Hire |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
{isAvailableForHire && ( |
|
|
|
<p className="mt-1 text-sm text-slate-500"> |
|
|
|
<p className="mt-1 text-sm text-slate-500"> |
|
|
|
Enable this if you are open to job opportunities, we will show a |
|
|
|
Make sure to keep your progress updated for |
|
|
|
badge on your profile to indicate that you are available for hire. |
|
|
|
potential employers. |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
|
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<button |
|
|
|
<button |
|
|
|