Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(blocks): make sidebar nav items without children render as SidebarMenuButton for sidebar-07 & sidebar-08 #6107

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

blackstarxr253
Copy link

@blackstarxr253 blackstarxr253 commented Dec 17, 2024

For nav elements that you don't want to render as a collapsible, I added a check that changes the render to a standard SidebarNavButton as long as the nav object has no children

Example

Nav entry with children

{
      title: "Playground",
      url: "#",
      icon: SquareTerminal,
      isActive: true,
      items: [
        {
          title: "History",
          url: "#",
        },
        {
          title: "Starred",
          url: "#",
        },
        {
          title: "Settings",
          url: "#",
        },
      ],
    },

since it has children, it should display as a collapsible
Screenshot 2024-12-17 at 9 12 26 AM

Nav entry without children

{
      title: "Dashboard",
      url: "/dashboard",
      icon: Home,
    },
    {
      title: "Playground",
      url: "#",
      icon: SquareTerminal,
      isActive: true,
      items: [
        {
          title: "History",
          url: "#",
        },
        {
          title: "Starred",
          url: "#",
        },
        {
          title: "Settings",
          url: "#",
        },
      ],
    },

since dashboard has no children, it should render as a button instead
Screenshot 2024-12-17 at 9 15 13 AM

Copy link

vercel bot commented Dec 17, 2024

@blackstarxr253 is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@blackstarxr253 blackstarxr253 changed the title feat(sidebar-07): make sidebar nav items without children render as SidebarMenuButton feat(blocks): make sidebar nav items without children render as SidebarMenuButton for sidebar-07 & sidebar-08 Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant