From 7600b1af893dcf2de08a4ce1a5bdeefa05ce06eb Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Tue, 9 Apr 2024 17:18:53 +0100 Subject: [PATCH] Refactor profile and form --- .../Navigation/AccountDropdownList.tsx | 2 +- src/components/RoadCard/SelectionButton.tsx | 15 ++++- .../UpdateProfile/UpdateProfileForm.tsx | 17 ++++-- .../UpdateProfile/UpdatePublicProfileForm.tsx | 57 +++++++++++++------ .../UserPublicProgresses.tsx | 48 +++++++--------- 5 files changed, 87 insertions(+), 52 deletions(-) diff --git a/src/components/Navigation/AccountDropdownList.tsx b/src/components/Navigation/AccountDropdownList.tsx index 395b67339..fcace5119 100644 --- a/src/components/Navigation/AccountDropdownList.tsx +++ b/src/components/Navigation/AccountDropdownList.tsx @@ -20,7 +20,7 @@ export function AccountDropdownList(props: AccountDropdownListProps) { className="group flex items-center gap-2 rounded py-2 pl-3 pr-2 text-sm font-medium text-slate-100 hover:bg-slate-700" > - Profile + Account
  • diff --git a/src/components/RoadCard/SelectionButton.tsx b/src/components/RoadCard/SelectionButton.tsx index 52dfa3b2b..2126a72d1 100644 --- a/src/components/RoadCard/SelectionButton.tsx +++ b/src/components/RoadCard/SelectionButton.tsx @@ -1,7 +1,9 @@ import type { ButtonHTMLAttributes } from 'react'; import { cn } from '../../lib/classname'; +import type { LucideIcon } from 'lucide-react'; type SelectionButtonProps = { + icon?: LucideIcon; text: string; isDisabled: boolean; isSelected: boolean; @@ -9,13 +11,21 @@ type SelectionButtonProps = { } & ButtonHTMLAttributes; export function SelectionButton(props: SelectionButtonProps) { - const { text, isDisabled, isSelected, onClick, className, ...rest } = props; + const { + icon: Icon, + text, + isDisabled, + isSelected, + onClick, + className, + ...rest + } = props; return ( ); diff --git a/src/components/UpdateProfile/UpdateProfileForm.tsx b/src/components/UpdateProfile/UpdateProfileForm.tsx index 84736f5c8..2782a3b75 100644 --- a/src/components/UpdateProfile/UpdateProfileForm.tsx +++ b/src/components/UpdateProfile/UpdateProfileForm.tsx @@ -101,12 +101,17 @@ export function UpdateProfileForm() { />
    - + + {isCreatingRoadmap && ( + setIsCreatingRoadmap(false)} /> + )} +

    Public Profile

    @@ -200,6 +206,7 @@ export function UpdatePublicProfileForm() { updateProfileVisibility('public')} @@ -207,6 +214,7 @@ export function UpdatePublicProfileForm() { updateProfileVisibility('private')} @@ -262,7 +270,9 @@ export function UpdatePublicProfileForm() {
    -

    Show my Learning Activity

    +

    + Pick the roadmaps to show your progress +

    { @@ -286,7 +296,9 @@ export function UpdatePublicProfileForm() { />
    -

    Only Following Roadmaps

    +

    + Only show the selected roadmaps +

    {publicRoadmaps.length > 0 ? (
    {publicRoadmaps.map((r) => ( @@ -326,7 +338,9 @@ export function UpdatePublicProfileForm() {
    -

    Show my Custom Roadmaps

    +

    + Pick the custom roadmaps to show on your profile +

    -

    Only Following Roadmaps

    +

    + Only show the following selected custom roadmaps +

    {publicCustomRoadmaps.length > 0 ? (
    {publicCustomRoadmaps.map((r) => ( @@ -377,11 +393,18 @@ export function UpdatePublicProfileForm() { ))}
    ) : ( -

    - You have not created any custom roadmaps yet.{' '} - - Create a custom roadmap - +

    + You do not have any custom roadmaps.{' '} + + .

    )}
    @@ -471,7 +494,7 @@ export function UpdatePublicProfileForm() {
    -
    +
    -

    - Enable this if you are open to job opportunities, we will show a - badge on your profile to indicate that you are available for hire. -

    + {isAvailableForHire && ( +

    + Make sure to keep your progress updated for + potential employers. +

    + )}