Sha256: e06918facbd6568163a723bfc4375c263519be8f5402a2ed25cb5f8b678b2908

Contents?: true

Size: 1.97 KB

Versions: 4

Compression:

Stored size: 1.97 KB

Contents

<%= object.pb_content_tag(:div, data: object.data.merge(initials: object.initials)) do %>
  <% if object.component_overlay && object.component_overlay[:component] == "icon_circle" %>
    <%= pb_rails("flex", props: {display: "display_inline_block", position: "relative" }) do %>
      <%= content_tag(:div, data: { initials: object.initials }, class: "avatar_wrapper") do %>
        <%= pb_rails("image", props: { alt: object.alt_text, url: object.image_url, on_error: object.handle_img_error }) if object.image_url.present? %>
      <% end %>
      <%= pb_rails("card", props: { border_none: true, border_radius: "rounded", html_options: { style: "padding: 2px" }, position: "absolute" }.merge(specific_placement_style)) do %>
        
        <%= pb_rails("icon_circle", props: { size: "xxs", icon: object.component_overlay[:icon] }) %>
      <% end %>  
  <% end %>
  <% elsif object.component_overlay && object.component_overlay[:component] == "badge" %>
  <%= pb_rails("flex", props: {display: "display_inline_block", position: "relative" }) do %>
    <%= content_tag(:div, data: { initials: object.initials }, class: "avatar_wrapper") do %>
      <%= pb_rails("image", props: { alt: object.alt_text, url: object.image_url, on_error: object.handle_img_error }) if object.image_url.present? %>
    <% end %>
    <%= pb_rails("card", props: { border_none: true, border_radius: "rounded", padding: "none", position: "absolute" }.merge(specific_placement_style)) do %>
    <%= pb_rails("badge", props: { rounded: true, text: object.component_overlay[:text], variant: object.component_overlay[:variant] }) %>
    <% end %>
    <% end %>
  <% else %>
    <%= content_tag(:div, data: { initials: object.initials }, class: "avatar_wrapper") do %>
      <%= pb_rails("image", props: { alt: object.alt_text, url: object.image_url, on_error: object.handle_img_error }) if object.image_url.present? %>
    <% end %>
    <%= pb_rails("online_status", props: object.online_status_props) if object.status %>
  <% end %>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
playbook_ui-13.27.0 app/pb_kits/playbook/pb_avatar/avatar.html.erb
playbook_ui-13.26.0.pre.alpha.PBNTR291Dropdownrailsv22840 app/pb_kits/playbook/pb_avatar/avatar.html.erb
playbook_ui-13.26.0.pre.alpha.jasoncypretpatch12820 app/pb_kits/playbook/pb_avatar/avatar.html.erb
playbook_ui-13.26.0.pre.alpha.jasoncypretpatch12816 app/pb_kits/playbook/pb_avatar/avatar.html.erb