Skip to content

Commit

Permalink
feat(tabs): fixed add feed button + tab style adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonhundt committed Jul 20, 2023
1 parent d072e17 commit d791689
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 21 deletions.
13 changes: 2 additions & 11 deletions app/assets/stylesheets/shared/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,8 @@
}
}

.btn-secondary-link {
transition: background-color 0.1s linear 0ms;
margin: 1rem 0.5rem;
padding: 0.5rem;
border: 1px dashed rgba(0, 0, 0, 0.12);
width: calc(100% - 1rem);
color: $primary;

&:hover {
color: $link-hover-color;
}
.prx-fixed-btn-container {
margin-bottom: 5rem;
}

.btn-icon {
Expand Down
9 changes: 7 additions & 2 deletions app/assets/stylesheets/shared/tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,18 @@
}

.prx-tab {
&:is(.nav-link, .nav-link.disable, .nav-link.active) {
&:is(.nav-link, .nav-link.disable) {
border-inline-start-width: map-get($spacers, 1);
background-color: rgba(var(--prx-tab-bg-rgb), var(--prx-tab-bg-opacity));
}

&:is(.nav-link.active) {
border-inline-start-width: map-get($spacers, 1);
background-color: $white;
}

&.active {
--prx-tab-bg-opacity: 0;
background-color: $white;
}

&:hover:not(.active) {
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def tab_link_to(*args, &block)

# add our tab classes
if html_options[:class].present?
html_options[:class] += " prx-tab | nav-link"
html_options[:class] += " prx-tab nav-link"
else
html_options[:class] = "prx-tab | nav-link"
html_options[:class] = "prx-tab nav-link"
end

# add aria current page
Expand Down
7 changes: 4 additions & 3 deletions app/views/feeds/_tabs.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% content_for :tabs do %>
<div class="list-group d-flex col">
<div class="list-group d-flex col prx-fixed-btn-container">
<% @feeds.each do |feed| %>
<% if feed.default? %>
<%= tab_link_to "Default Feed", podcast_feed_path(@podcast, feed) %>
Expand All @@ -11,7 +11,8 @@
<% if feed.new_record? %>
<%= tab_link_to "New Feed", new_podcast_feed_path(podcast), active: true %>
<% end %>
<%= link_to "Add a Feed", new_podcast_feed_path(podcast), class: "btn btn-secondary-link" %>
</div>
<div class="fixed-bottom col-sm-12 col-md-3 col-xl-2">
<%= link_to "Add a Feed", new_podcast_feed_path(podcast), class: "btn btn-success d-flex sticky-md-bottom m-4 shadow" %>
</div>
<% end %>
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="prx-main container-fluid flex-grow-1">
<div class="row">
<aside class="prx-tabs d-flex flex-column justify-content-between col-sm-12 col-md-3 col-xl-2">
<nav class="prx-tabs-nav nav nav-tabs flex-column bg-white sticky-md-top">
<nav class="prx-tabs-nav nav nav-tabs flex-column sticky-md-top">
<%= yield :tabs %>
</nav>
<% if content_for? :actions %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/podcasts/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="col-12">
<%= render "form_status", podcast: podcast, form: form %>
</div>
</div>
</div>
</div>
</div>
<% end %>
2 changes: 1 addition & 1 deletion app/views/podcasts/_form_main.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@

<div class="col-12 mb-4">
<%= render "form_feed_image", podcast: podcast, form: form %>
</div>
</div>

0 comments on commit d791689

Please sign in to comment.