Skip to content

Commit

Permalink
feat: hide View button from selected path
Browse files Browse the repository at this point in the history
  • Loading branch information
davidha99 committed Apr 24, 2024
1 parent 6b29bbc commit bc05571
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/views/paths/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<h2 class="text-3xl font-medium text-gray-800 dark:text-gray-300">Foundations</h2>
<% end %>
</div>
<% if current_user.present? and current_user.on_path?(@foundations) %>
<% if current_user.present? && current_user.on_path?(@foundations) %>
<div class="absolute top-3.5 right-3.5 !mt-0 md:static">
<%= render Ui::BadgeComponent.new(color: 'green') do %>
<%= @badge_text %>
Expand All @@ -27,7 +27,7 @@

<div class="space-x-6 justify-center hidden md:flex">
<%= render Paths::SelectButtonComponent.new(current_user:, path: @foundations, classes: 'px-12') %>
<%= render Paths::ViewButtonComponent.new(current_user:, path: @foundations, classes: 'px-12') %>
<%= render Paths::ViewButtonComponent.new(current_user:, path: @foundations, classes: "px-12 #{'hidden' if current_user.present? && current_user.on_path?(@foundations)}") %>
</div>
</div>
<% end %>
Expand All @@ -39,7 +39,7 @@
<% card.with_footer do |card| %>
<div class="flex space-x-6 justify-center sm:items-center sm:justify-start md:hidden">
<%= render Paths::SelectButtonComponent.new(current_user:, path: @foundations, classes: 'px-10') %>
<%= render Paths::ViewButtonComponent.new(current_user:, path: @foundations, classes: 'px-10') %>
<%= render Paths::ViewButtonComponent.new(current_user:, path: @foundations, classes: "px-10 #{'hidden' if current_user.present? && current_user.on_path?(@foundations)}") %>
</div>
<% end %>
<% end %>
Expand Down Expand Up @@ -90,7 +90,7 @@
<% card.with_footer do %>
<div class="flex space-x-6 items-center justify-center sm:justify-start">
<%= render Paths::SelectButtonComponent.new(current_user:, path:, classes: 'px-10 lg:px-12') %>
<%= render Paths::ViewButtonComponent.new(current_user:, path:, classes: 'px-10 lg:px-12') %>
<%= render Paths::ViewButtonComponent.new(current_user:, path:, classes: "px-10 lg:px-12 #{'hidden' if current_user.present? && current_user.on_path?(path)}") %>
</div>
<% end %>
<% end %>
Expand Down

0 comments on commit bc05571

Please sign in to comment.