diff --git a/apps/docs/components/icons.tsx b/apps/docs/components/icons.tsx index 19f650044c3..ca2a9b16353 100644 --- a/apps/docs/components/icons.tsx +++ b/apps/docs/components/icons.tsx @@ -4143,7 +4143,7 @@ export function InfisicalIcon(props: SVGProps) { ) diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx index 2fe2a5e27b3..8e4a7a2c654 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx @@ -199,27 +199,41 @@ const SidebarNavItem = memo(function SidebarNavItem({ 'group flex h-[30px] items-center gap-[8px] rounded-[8px] mx-[2px] px-[8px] text-[14px] hover:bg-[var(--surface-active)]' const activeClasses = active ? 'bg-[var(--surface-active)]' : '' - const element = item.onClick ? ( - - ) : ( + + ) + + const element = item.href ? ( { + if (e.ctrlKey || e.metaKey || e.shiftKey) return + e.preventDefault() + item.onClick!() + } + : undefined + } onContextMenu={onContextMenu ? (e) => onContextMenu(e, item.href!) : undefined} > - - {item.label} + {content} - ) + ) : item.onClick ? ( + + ) : null return ( @@ -263,7 +277,7 @@ export const Sidebar = memo(function Sidebar() { const { data: sessionData, isPending: sessionLoading } = useSession() const { canEdit } = useUserPermissionsContext() const { config: permissionConfig, filterBlocks } = usePermissionConfig() - const { navigateToSettings } = useSettingsNavigation() + const { navigateToSettings, getSettingsHref } = useSettingsNavigation() const initializeSearchData = useSearchModalStore((state) => state.initializeData) useEffect(() => { @@ -592,6 +606,7 @@ export const Sidebar = memo(function Sidebar() { id: 'settings', label: 'Settings', icon: Settings, + href: getSettingsHref(), onClick: () => { if (!isCollapsed) { setSidebarWidth(SIDEBAR_WIDTH.MIN) @@ -600,7 +615,7 @@ export const Sidebar = memo(function Sidebar() { }, }, ], - [workspaceId, navigateToSettings, isCollapsed, setSidebarWidth] + [workspaceId, navigateToSettings, getSettingsHref, isCollapsed, setSidebarWidth] ) const { data: fetchedTasks = [], isLoading: tasksLoading } = useTasks(workspaceId) @@ -1381,6 +1396,7 @@ export const Sidebar = memo(function Sidebar() { item={item} active={false} showCollapsedContent={showCollapsedContent} + onContextMenu={item.href ? handleNavItemContextMenu : undefined} /> ))} diff --git a/apps/sim/components/icons.tsx b/apps/sim/components/icons.tsx index 19f650044c3..ca2a9b16353 100644 --- a/apps/sim/components/icons.tsx +++ b/apps/sim/components/icons.tsx @@ -4143,7 +4143,7 @@ export function InfisicalIcon(props: SVGProps) { )