Skip to content

Commit

Permalink
chore: update sidebar styles
Browse files Browse the repository at this point in the history
  • Loading branch information
yasell committed Jan 29, 2025
1 parent d66201a commit 5154a40
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export const useRootViewWrapperStore = () => {
},
{
groupId: 8,
title: 'Acces Control',
title: 'Access Control',
type: MenuGroupTypes.SETTINGS,
items: [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/locales/en/component.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"overrides": "Overrides",
"certificates": "Certificates",
"webhooks": "Webhooks",
"access-control": "Acces Control",
"access-control": "Access Control",
"users": "Users",
"user-groups": "User Groups",
"service-accounts": "Service Accounts",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/manage-navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export const ManageNavigation = ({
key={item.id}
className="flex w-full grow cursor-not-allowed items-center gap-x-2.5 rounded p-1 px-3 opacity-55"
>
<Icon className="w-3.5" name="shield-lock" size={14} />
<Icon className="w-3.5" name="lock" size={14} />
<Text>{item.title}</Text>
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/navbar-skeleton/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function Group({ children, title, topBorder, isSubMenu = false, titleClas
className={cn(
'flex w-full flex-col px-5',
{ 'border-borders-5 border-t pt-2.5': topBorder },
isSubMenu ? 'pb-2.5' : 'gap-1.5 pb-3',
isSubMenu ? 'pb-2.5 gap-y-0.5' : 'gap-1.5 pb-3',
className
)}
>
Expand Down
32 changes: 18 additions & 14 deletions packages/ui/src/components/navbar/navbar-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { NavbarItemType } from '../types'
interface NavbarItemProps {
item: NavbarItemType
isRecent?: boolean
isStaticPinned?: boolean
handleChangePinnedMenuItem: (item: NavbarItemType, pin: boolean) => void
handleRemoveRecentMenuItem: (item: NavbarItemType) => void
handleCustomNav: () => void
Expand All @@ -18,6 +19,7 @@ interface NavbarItemProps {
export const NavbarItem = ({
item,
isRecent = false,
isStaticPinned = false,
handleChangePinnedMenuItem,
handleRemoveRecentMenuItem,
handleCustomNav,
Expand Down Expand Up @@ -75,20 +77,22 @@ export const NavbarItem = ({
/>
)}
</NavLink>
<DropdownMenu.Root>
<DropdownMenu.Trigger asChild>
<Button
className="absolute right-[-0.8125rem] top-0 text-icons-4 opacity-0 hover:text-icons-2 focus:opacity-100 focus-visible:opacity-100 group-hover:opacity-100 data-[state=open]:opacity-100"
size="sm_icon"
variant="custom"
>
<Icon name="menu-dots" size={12} />
</Button>
</DropdownMenu.Trigger>
<DropdownMenu.Content className="w-[128px]" align="end" sideOffset={-1} alignOffset={8}>
{dropdownItems}
</DropdownMenu.Content>
</DropdownMenu.Root>
{!isStaticPinned && (
<DropdownMenu.Root>
<DropdownMenu.Trigger asChild>
<Button
className="absolute right-[-0.8125rem] top-0 text-icons-4 opacity-0 hover:text-icons-2 focus:opacity-100 focus-visible:opacity-100 group-hover:opacity-100 data-[state=open]:opacity-100"
size="sm_icon"
variant="custom"
>
<Icon name="menu-dots" size={12} />
</Button>
</DropdownMenu.Trigger>
<DropdownMenu.Content className="w-[128px]" align="end" sideOffset={-1} alignOffset={8}>
{dropdownItems}
</DropdownMenu.Content>
</DropdownMenu.Root>
)}
</div>
)
}
14 changes: 7 additions & 7 deletions packages/ui/src/components/navbar/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const Navbar = ({
handleChangePinnedMenuItem={handleChangePinnedMenuItem}
handleRemoveRecentMenuItem={handleRemoveRecentMenuItem}
handleCustomNav={handleCustomNav}
isStaticPinned
t={t}
/>
))}
Expand All @@ -104,6 +105,12 @@ export const Navbar = ({
)}

<NavbarSkeleton.Group topBorder>
{!!currentUser?.admin && (
<Link to="/admin/default-settings">
<NavbarSkeleton.Item text="User Management" icon={<Icon name="account" size={12} />} />
</Link>
)}

<button onClick={handleSettingsMenu}>
<NavbarSkeleton.Item
text={adminMenuItem.title}
Expand All @@ -115,13 +122,6 @@ export const Navbar = ({
</ScrollArea>

{/*<NavbarAi />*/}
{!!currentUser?.admin && (
<NavbarSkeleton.Group>
<Link to="/admin/default-settings">
<NavbarSkeleton.Item text="User Management" icon={<Icon name="account" size={12} />} />
</Link>
</NavbarSkeleton.Group>
)}
</NavbarSkeleton.Content>

<NavbarSkeleton.Footer>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/views/layouts/SandboxLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function Root({ children }: { children: ReactNode }) {

function LeftPanel({ children, className }: { children: ReactNode; className?: string }) {
return (
<div className="sticky top-0 h-screen">
<div className="sticky top-0 z-10 h-screen">
<nav className={cn('h-full w-[220px] border-borders-5', className)} aria-label="Left Navigation Panel">
{children}
</nav>
Expand Down

0 comments on commit 5154a40

Please sign in to comment.