petalframework / petal_components

Phoenix + Live View HEEX Components
https://petal.build/components
MIT License
818 stars 94 forks source link

Sidebar layout does not display #230

Closed pyladune closed 1 year ago

pyladune commented 1 year ago

Side bar layout does not display sidebar by default.

however there is still a way to display it : if size screen is reduce and bar icon is clicked, then sidebar appear and remain even if window is full screen

Since sidebar seems to use Alpine, i checked that Alpine is working properly Capture d’écran du 2023-07-22 10-43-21

<.sidebar_layout
  current_page={:dashboard}
  main_menu_items={
    [
  %{
    title: "Group 1",
    menu_items: [
      %{
        name: :company_reports,
        label: "Reports",
        icon: :chart_pie,
        path: ~p"/company/reports"
      },
    ]
  },
  %{
    title: "Group 2",
    menu_items: [
      %{
        name: :company_settings,
        label: "Settings",
        icon: :cog_6_tooth,
        path: ~p"/company/settings"
      }
    ]
  }
]
  }
  user_menu_items={[
    %{
      name: :login,
      label: "Login",
      path: ~p"/",
      icon: :key
    }
  ]}
>
  <:logo>
    <img class="h-8" src="https://res.cloudinary.com/wickedsites/image/upload/v1635752721/petal/logo_rh2ras.png" />
  </:logo>
<%= @inner_content %>
</.sidebar_layout>
nhobes commented 1 year ago

@pyladune this has been added as a task to the Petal Development board.

https://github.com/orgs/petalframework/projects/2/views/1

mplatts commented 1 year ago

Hmm this works for me. @pyladune did you work out what was causing it? My first suspicion would be alpine, but you said this was working. Maybe inspect the styling and see what is causing it to be hidden