Skip to content

Commit

Permalink
feat: Add dropdown navigation for projects and update sidebar labels
Browse files Browse the repository at this point in the history
  • Loading branch information
joshsadam committed Dec 5, 2024
1 parent 91c7619 commit 519c09c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
27 changes: 26 additions & 1 deletion app/components/layout/sidebar_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,33 @@
<% end %>
</div>
</div>
<div
class="bg-slate-200 dark:border-slate-950 p-2"
data-controller="viral--dropdown"
data-viral--dropdown-skidding-value="-300"
data-viral--dropdown-distance-value="5"
>
<button
class="
border rounded-md border-slate-400 bg-slate-50 hover:bg-slate-300 w-full py-2
"
data-viral--dropdown-target='trigger'
>Go to</button>
<div
data-viral--dropdown-target="menu"
class="
z-20 hidden mx-3 bg-white divide-y rounded-lg shadow divide-slate-100
dark:bg-slate-700
"
>
<ul class="py-2 text-sm text-slate-700 dark:text-slate-200">
<li><%= link_to t(:"general.default_sidebar.projects"), dashboard_projects_path %></li>

</ul>
</div>
</div>
<div class="flex-1 space-y-1">
<%= viral_dropdown(label: t("general.default_sidebar.goto"), tooltip: tooltip, caret: true, classes: "w-full border-none dark:bg-slate-900 px-4 bg-slate-900 rounded-none", skidding: -300, dropdown_styles: "width: 276px;", distance: 5) do |dropdown| %>
<%= viral_dropdown(label: t("general.default_sidebar.goto"), tooltip: tooltip, classes: "w-full border-none dark:bg-slate-900 text-center px-4 bg-slate-900 rounded-none", skidding: -300, dropdown_styles: "width: 276px;", distance: 5) do |dropdown| %>
<%= dropdown.with_item(
label: t(:"general.default_sidebar.projects"),
url: dashboard_projects_path,
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/groups.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<%= render section.with_item(
url: group_path(@group),
icon: "squares_2x2",
label: @group.name,
label: t("groups.sidebar.details"),
selected: @current_page == t(:"groups.sidebar.details"),
) %>
<%= render section.with_item(
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/projects.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<%= render section.with_item(
url: project_path(@project),
icon: "clipboard_document",
label: @project.name,
label: t("projects.sidebar.details"),
selected: @current_page == t(:"projects.sidebar.details"),
) %>
<%= render section.with_item(
Expand Down

0 comments on commit 519c09c

Please sign in to comment.