Skip to content

Commit

Permalink
move my assistants up for builders, members up for admin (#2908)
Browse files Browse the repository at this point in the history
  • Loading branch information
spolu authored Dec 18, 2023
1 parent 9f112e7 commit d7d7fe5
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions front/components/sparkle/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const topNavigation = ({
id: "assistants",
label: "Assistants",
icon: RobotIcon,
href: `/w/${owner.sId}/builder/assistants`,
href: `/w/${owner.sId}/assistant/assistants`,
current: current === "assistants",
sizing: "hug",
hasSeparator: true,
Expand All @@ -109,7 +109,7 @@ export const topNavigation = ({
icon: Cog6ToothIcon,
href:
owner.role === "admin"
? `/w/${owner.sId}/workspace`
? `/w/${owner.sId}/members`
: `/w/${owner.sId}/a`,
current: current === "admin",
sizing: "hug",
Expand Down Expand Up @@ -170,18 +170,7 @@ export const subNavigationAssistants = ({
}) => {
const nav: SidebarNavigation[] = [];

const assistantMenus: SparkleAppLayoutNavigation[] = [
{
id: "workspace_assistants",
label: "Workspace Assistants",
icon: RobotSharedIcon,
href: `/w/${owner.sId}/builder/assistants`,
current: current === "workspace_assistants",
subMenuLabel:
current === "workspace_assistants" ? subMenuLabel : undefined,
subMenu: current === "workspace_assistants" ? subMenu : undefined,
},
];
const assistantMenus: SparkleAppLayoutNavigation[] = [];

if (owner.role === "builder" || owner.role === "admin") {
assistantMenus.push({
Expand All @@ -196,6 +185,16 @@ export const subNavigationAssistants = ({
});
}

assistantMenus.push({
id: "workspace_assistants",
label: "Workspace Assistants",
icon: RobotSharedIcon,
href: `/w/${owner.sId}/builder/assistants`,
current: current === "workspace_assistants",
subMenuLabel: current === "workspace_assistants" ? subMenuLabel : undefined,
subMenu: current === "workspace_assistants" ? subMenu : undefined,
});

nav.push({
id: "assistants",
label: null,
Expand Down Expand Up @@ -257,6 +256,15 @@ export const subNavigationAdmin = ({
label: null,
variant: "secondary",
menus: [
{
id: "members",
label: "Members",
icon: UsersIcon,
href: `/w/${owner.sId}/members`,
current: current === "members",
subMenuLabel: current === "members" ? subMenuLabel : undefined,
subMenu: current === "members" ? subMenu : undefined,
},
{
id: "workspace",
label: "Workspace",
Expand All @@ -275,15 +283,6 @@ export const subNavigationAdmin = ({
subMenuLabel: current === "subscription" ? subMenuLabel : undefined,
subMenu: current === "subscription" ? subMenu : undefined,
},
{
id: "members",
label: "Members",
icon: UsersIcon,
href: `/w/${owner.sId}/members`,
current: current === "members",
subMenuLabel: current === "members" ? subMenuLabel : undefined,
subMenu: current === "members" ? subMenu : undefined,
},
],
});
}
Expand Down

0 comments on commit d7d7fe5

Please sign in to comment.