Small optimization: Don't include --active variation on button for non-logged-in (#11676)

This commit is contained in:
Ben Halpern 2020-11-30 10:03:06 -05:00 committed by GitHub
parent a6537dde95
commit 652f8112d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,8 +7,10 @@
<span class="crayons-reaction__icon crayons-reaction__icon--inactive">
<%= inline_svg_tag(image_path, aria: true, class: "crayons-icon", title: description) %>
</span>
<% if user_signed_in? # We cannot trigger the action state unless the user is signed in, so no need to render. %>
<span class="crayons-reaction__icon crayons-reaction__icon--active">
<%= inline_svg_tag(image_active_path, aria: true, class: "crayons-icon", title: description) %>
</span>
<% end %>
<span class="crayons-reaction__count" id="reaction-number-<%= category %>" alt="count"><span class="bg-base-40 opacity-25 p-2 inline-block radius-default"></span></span>
</button>