Skip to content

Commit

Permalink
nav links - center icons
Browse files Browse the repository at this point in the history
  • Loading branch information
yshmarov committed Nov 10, 2024
1 parent 2195914 commit 38f42c7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
30 changes: 18 additions & 12 deletions app/views/shared/_nav_links.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
<%= active_link_to organization_path(current_organization), active: :exclusive, class_active: "bg-gray-300", class: "w-full btn btn-transparent" do %>
<%= inline_svg_tag "svg/question-mark-circle.svg", class: "size-5" %>
<span>
<%= active_link_to organization_path(current_organization), active: :exclusive, class_active: "bg-gray-300", class: "w-full items-center btn btn-transparent" do %>
<div>
<%= inline_svg_tag "svg/question-mark-circle.svg", class: "size-5" %>
</div>
<div>
Dashboard
</span>
</div>
<% end %>
<%= active_link_to organization_memberships_path(@organization), class_active: "bg-gray-300", class: "w-full btn btn-transparent" do %>
<%= inline_svg_tag "svg/user-group.svg", class: "size-5" %>
<span>
<%= active_link_to organization_memberships_path(@organization), class_active: "bg-gray-300", class: "w-full items-center btn btn-transparent" do %>
<div>
<%= inline_svg_tag "svg/user-group.svg", class: "size-5" %>
</div>
<div>
Users
</span>
</div>
<% end %>
<%= active_link_to organization_inboxes_path(@organization), class_active: "bg-gray-300", class: "w-full btn btn-transparent" do %>
<%= inline_svg_tag "svg/question-mark-circle.svg", class: "size-5" %>
<span>
<%= active_link_to organization_inboxes_path(@organization), class_active: "bg-gray-300", class: "w-full items-center btn btn-transparent" do %>
<div>
<%= inline_svg_tag "svg/question-mark-circle.svg", class: "size-5" %>
</div>
<div>
Inboxes
</span>
</div>
<% end %>
10 changes: 6 additions & 4 deletions lib/generators/scaffold/scaffold_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ class ScaffoldGenerator < Rails::Generators::NamedBase
def add_to_navigation
append_to_file "app/views/shared/_nav_links.html.erb" do
<<-ERB
<%= active_link_to #{index_helper(type: :path)}, class_active: "bg-gray-300", class: "w-full btn btn-transparent" do %>
<%= inline_svg_tag "svg/question-mark-circle.svg", class: "size-5" %>
<span>
<%= active_link_to #{index_helper(type: :path)}, class_active: "bg-gray-300", class: "w-full items-center btn btn-transparent" do %>
<div>
<%= inline_svg_tag "svg/question-mark-circle.svg", class: "size-5" %>
</div>
<div>
#{plural_table_name.titleize}
</span>
</div>
<% end %>
ERB
end
Expand Down

0 comments on commit 38f42c7

Please sign in to comment.