diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b58d5c3..da564d2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -5,8 +5,18 @@ module ApplicationHelper options = content_or_options_with_block if content_or_options_with_block.is_a?(Hash) end - color = options.fetch(:color).presence || "gray" - classes = "px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-#{color}-100 text-#{color}-800" + color_classes = case options.fetch(:color) + when "red" + "bg-red-100 text-red-800" + when "green" + "bg-green-100 text-green-800" + when "orange" + "bg-orange-100 text-orange-800" + else + "bg-gray-100 text-gray-800" + end + + classes = "px-2 inline-flex text-xs leading-5 font-semibold rounded-full #{color_classes}" if block_given? content_tag(:span, class: classes, &block) diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 911a883..cb73f26 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -55,14 +55,14 @@ <% if user.confirmed? %> <%= colored_pill_tag("Confirmed", color: "green") %> <% else %> - <%= colored_pill_tag("Unconfirmed", color: "yellow") %> + <%= colored_pill_tag("Unconfirmed", color: "orange") %> <% end %> <% if user.admin? %> <%= colored_pill_tag("Yes", color: "green") %> <% else %> - <%= colored_pill_tag("No", color: "yellow") %> + <%= colored_pill_tag("No", color: "gray") %> <% end %>