Changes to form

pull/5494/head
Kamran Ahmed 8 months ago
parent 5f97ea8e4f
commit 3cb31da862
  1. 41
      src/components/UpdateProfile/UpdatePublicProfileForm.tsx

@ -34,9 +34,9 @@ export function UpdatePublicProfileForm() {
const [headline, setHeadline] = useState(''); const [headline, setHeadline] = useState('');
const [username, setUsername] = useState(''); const [username, setUsername] = useState('');
const [roadmapVisibility, setRoadmapVisibility] = const [roadmapVisibility, setRoadmapVisibility] =
useState<AllowedRoadmapVisibility>('none'); useState<AllowedRoadmapVisibility>('all');
const [customRoadmapVisibility, setCustomRoadmapVisibility] = const [customRoadmapVisibility, setCustomRoadmapVisibility] =
useState<AllowedCustomRoadmapVisibility>('none'); useState<AllowedCustomRoadmapVisibility>('all');
const [roadmaps, setRoadmaps] = useState<string[]>([]); const [roadmaps, setRoadmaps] = useState<string[]>([]);
const [customRoadmaps, setCustomRoadmaps] = useState<string[]>([]); const [customRoadmaps, setCustomRoadmaps] = useState<string[]>([]);
@ -104,7 +104,7 @@ export function UpdatePublicProfileForm() {
publicConfig, publicConfig,
} = response; } = response;
setPublicProfileUrl(`/u/${username}`); setPublicProfileUrl(username ? `/u/${username}` : '');
setUsername(username || ''); setUsername(username || '');
setGithub(links?.github || ''); setGithub(links?.github || '');
setTwitter(links?.twitter || ''); setTwitter(links?.twitter || '');
@ -186,9 +186,9 @@ export function UpdatePublicProfileForm() {
return ( return (
<> <>
<div className="mt-16 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-3xl font-bold">Public Profile</h3> <h3 className="text-2xl font-bold">Public Profile</h3>
{publicProfileUrl && ( {publicProfileUrl && (
<a href={publicProfileUrl} target="_blank" className="shrink-0"> <a href={publicProfileUrl} target="_blank" className="shrink-0">
<ArrowUpRight className="h-6 w-6 stroke-[3]" /> <ArrowUpRight className="h-6 w-6 stroke-[3]" />
@ -267,17 +267,17 @@ export function UpdatePublicProfileForm() {
<SelectionButton <SelectionButton
type="button" type="button"
text="All Roadmaps" text="All Roadmaps"
isDisabled={isAllRoadmapsSelected} isDisabled={false}
isSelected={isAllRoadmapsSelected} isSelected={roadmapVisibility === 'all'}
onClick={() => { onClick={() => {
setRoadmapVisibility('all'); setRoadmapVisibility('all');
setRoadmaps([...publicRoadmaps.map((r) => r.id)]); setRoadmaps([]);
}} }}
/> />
<SelectionButton <SelectionButton
type="button" type="button"
text="Hide my Activity" text="Hide my Activity"
isDisabled={roadmapVisibility === 'none'} isDisabled={false}
isSelected={roadmapVisibility === 'none'} isSelected={roadmapVisibility === 'none'}
onClick={() => { onClick={() => {
setRoadmapVisibility('none'); setRoadmapVisibility('none');
@ -311,11 +311,16 @@ 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 are not following any roadmaps yet.{' '} Update{' '}
<a href="/roadmaps" className="text-black underline"> <a
Start following roadmaps target="_blank"
</a> className="font-medium underline underline-offset-2 hover:text-yellow-800"
href="/roadmaps"
>
your progress on roadmaps
</a>{' '}
to show your learning activity.
</p> </p>
)} )}
</div> </div>
@ -326,17 +331,17 @@ export function UpdatePublicProfileForm() {
<SelectionButton <SelectionButton
type="button" type="button"
text="All Roadmaps" text="All Roadmaps"
isDisabled={isAllCustomRoadmapsSelected} isDisabled={false}
isSelected={isAllCustomRoadmapsSelected} isSelected={customRoadmapVisibility === 'all'}
onClick={() => { onClick={() => {
setCustomRoadmapVisibility('all'); setCustomRoadmapVisibility('all');
setCustomRoadmaps([...publicCustomRoadmaps.map((r) => r.id)]); setCustomRoadmaps([]);
}} }}
/> />
<SelectionButton <SelectionButton
type="button" type="button"
text="Hide my Custom Roadmaps" text="Hide my Custom Roadmaps"
isDisabled={customRoadmapVisibility === 'none'} isDisabled={false}
isSelected={customRoadmapVisibility === 'none'} isSelected={customRoadmapVisibility === 'none'}
onClick={() => { onClick={() => {
setCustomRoadmapVisibility('none'); setCustomRoadmapVisibility('none');

Loading…
Cancel
Save