diff --git a/app/components/pet_avatar_component.rb b/app/components/pet_avatar_component.rb index 68d8635e9..90086b0ff 100644 --- a/app/components/pet_avatar_component.rb +++ b/app/components/pet_avatar_component.rb @@ -4,6 +4,7 @@ class PetAvatarComponent < ApplicationComponent param :pet, Types::Instance(Pet) option :like, optional: true + option :size, Types::Size, default: -> { :md } private @@ -32,10 +33,20 @@ def image_class end def initials_class - "avatar-initials rounded-circle fs-2" + case size + when :md + "avatar-initials rounded-circle" + when :xl + "avatar-initials rounded-circle fs-2" + end end def container_class - "avatar avatar-xl avatar-primary rounded-circle border border-4 border-white" + case size + when :md + "avatar avatar-md avatar-primary rounded-circle border border-1 border-primary" + when :xl + "avatar avatar-xl avatar-primary rounded-circle border border-4 border-white" + end end end diff --git a/app/views/organizations/staff/pets/show.html.erb b/app/views/organizations/staff/pets/show.html.erb index 6dd2c46a0..910436483 100644 --- a/app/views/organizations/staff/pets/show.html.erb +++ b/app/views/organizations/staff/pets/show.html.erb @@ -1,5 +1,8 @@ <%= render DashboardPageComponent.new(crumb: :dashboard_pet, crumb_options: [@pet]) do |c| %> - <% c.with_header_title { @pet.name } %> + <% c.with_header_title do %> + <%= render PetAvatarComponent.new(@pet)%> + <%= @pet.name%> + <% end %> <% c.with_nav_tabs([ { url: staff_pet_path(@pet, active_tab: 'overview'), text: "Overview" }, { url: staff_pet_path(@pet, active_tab: 'tasks'), text: "Tasks" }, @@ -11,22 +14,9 @@ <% c.with_body do %>
-
+
<%= render partial: "organizations/staff/pets/tabs/#{@active_tab}", locals: { applications: @pet.adopter_applications, pet: @pet, fosters: @pet.matches.fosters } %>
- -
- -
-
- <% if @pet.images.attached? %> - <%= image_tag @pet.images.first, class: 'rounded card-img-top' %> - <% else %> - <%= image_tag('coming_soon.jpg', class: 'rounded card-img-top') %> - <% end %> -
-
-
<% end %> <% end %>