[WEB-2025] chore: profile page enhancements (#5209)

* chore: user layout and header updated

* chore: user page sidebar improvement

* fix: your work redirection

* fix: profile section mobile navigation dropdown

* chore: profile layout improvement

* chore: profile header improvement

* fix: profile section header improvement

* fix: app sidebar your work active indicator

* chore: profile sidebar improvement

* chore: user menu code refactor

* chore: header code refactor

* chore: user menu code refactor

* fix: build error
This commit is contained in:
Anmol Singh Bhatia 2024-07-24 17:52:12 +05:30 committed by GitHub
parent 58f203dd38
commit 4d978c1a8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 117 additions and 78 deletions

View file

@ -293,12 +293,16 @@ export const SIDEBAR_WORKSPACE_MENU_ITEMS: {
},
];
type TLinkOptions = {
userId: string | undefined;
};
export const SIDEBAR_USER_MENU_ITEMS: {
key: string;
label: string;
href: string;
access: EUserWorkspaceRoles;
highlight: (pathname: string, baseUrl: string) => boolean;
highlight: (pathname: string, baseUrl: string, options?: TLinkOptions) => boolean;
Icon: React.FC<Props>;
}[] = [
{
@ -314,7 +318,8 @@ export const SIDEBAR_USER_MENU_ITEMS: {
label: "Your work",
href: "/profile",
access: EUserWorkspaceRoles.GUEST,
highlight: (pathname: string, baseUrl: string) => pathname.includes(`${baseUrl}/profile/`),
highlight: (pathname: string, baseUrl: string, options?: TLinkOptions) =>
options?.userId ? pathname.includes(`${baseUrl}/profile/${options?.userId}`) : false,
Icon: UserActivityIcon,
},
{

View file

@ -31,26 +31,26 @@ export const PROFILE_ACTION_LINKS: {
Icon: Activity,
},
{
key: "appearance",
label: "Appearance",
href: `/profile/appearance`,
highlight: (pathname: string) => pathname.includes("/profile/appearance"),
Icon: Settings2,
},
{
key: "notifications",
label: "Notifications",
href: `/profile/notifications`,
highlight: (pathname: string) => pathname === "/profile/notifications/",
Icon: Bell,
},
key: "appearance",
label: "Appearance",
href: `/profile/appearance`,
highlight: (pathname: string) => pathname.includes("/profile/appearance"),
Icon: Settings2,
},
{
key: "notifications",
label: "Notifications",
href: `/profile/notifications`,
highlight: (pathname: string) => pathname === "/profile/notifications/",
Icon: Bell,
},
];
export const PROFILE_VIEWER_TAB = [
{
route: "",
label: "Summary",
selected: "",
selected: "/",
},
];
@ -58,21 +58,21 @@ export const PROFILE_ADMINS_TAB = [
{
route: "assigned",
label: "Assigned",
selected: "/assigned",
selected: "/assigned/",
},
{
route: "created",
label: "Created",
selected: "/created",
selected: "/created/",
},
{
route: "subscribed",
label: "Subscribed",
selected: "/subscribed",
selected: "/subscribed/",
},
{
route: "activity",
label: "Activity",
selected: "/activity",
selected: "/activity/",
},
];