FIX: Set button styles using new button_class API

FIX: Set button styles using new button_class API

This removes @import common/components/buttons, which was causing some unintended side effects.

Follow-up to c85e23b09ef43969a80a0089d8ac11861328b3eb

diff --git a/assets/stylesheets/reviewable-akismet-post-styles.scss b/assets/stylesheets/reviewable-akismet-post-styles.scss
index 4af0256..0fea259 100644
--- a/assets/stylesheets/reviewable-akismet-post-styles.scss
+++ b/assets/stylesheets/reviewable-akismet-post-styles.scss
@@ -1,5 +1,3 @@
-@import "common/components/buttons";
-
 .reviewable-akismet-post {
   .created-by {
     margin-right: 1em;
@@ -9,11 +7,3 @@
     width: 100%;
   }
 }
-
-.reviewable-akismet-post,
-.reviewable-akismet-user {
-  .confirm-delete,
-  .reject-user-delete {
-    @extend .btn-danger;
-  }
-}
diff --git a/models/reviewable_akismet_post.rb b/models/reviewable_akismet_post.rb
index cec1a70..afc5844 100644
--- a/models/reviewable_akismet_post.rb
+++ b/models/reviewable_akismet_post.rb
@@ -9,7 +9,7 @@ class ReviewableAkismetPost < Reviewable
     build_action(actions, :confirm_spam, icon: 'check')
     build_action(actions, :not_spam, icon: 'thumbs-up')
     build_action(actions, :ignore, icon: 'times')
-    build_action(actions, :confirm_delete, icon: 'trash-alt', confirm: true) if guardian.is_staff?
+    build_action(actions, :confirm_delete, icon: 'trash-alt', confirm: true, button_class: "btn-danger") if guardian.is_staff?
   end
 
   def post
diff --git a/models/reviewable_akismet_user.rb b/models/reviewable_akismet_user.rb
index cce4766..f02f633 100644
--- a/models/reviewable_akismet_user.rb
+++ b/models/reviewable_akismet_user.rb
@@ -7,7 +7,7 @@ class ReviewableAkismetUser < Reviewable
     return [] unless pending?
 
     build_action(actions, :not_spam, icon: 'thumbs-up')
-    build_action(actions, :reject_user_delete, icon: 'trash-alt', confirm: true) if guardian.is_staff?
+    build_action(actions, :reject_user_delete, icon: 'trash-alt', confirm: true, button_class: "btn-danger") if guardian.is_staff?
   end
 
   # Reviewable#perform should be used instead of these action methods.

GitHub sha: 770a712b

1 Like

FIX: Add button_class arguments to the build_action functions