Class: Playbook::PbAvatar::Avatar
- Inherits:
-
KitBase
- Object
- ViewComponent::Base
- KitBase
- Playbook::PbAvatar::Avatar
show all
- Defined in:
- app/pb_kits/playbook/pb_avatar/avatar.rb
Instance Method Summary
collapse
Methods inherited from KitBase
#object
Methods included from ZIndex
included
Methods included from Spacing
included, #max_width_options, #max_width_props, #max_width_values, #spacing_options, #spacing_props, #spacing_values
Methods included from Classnames
#generate_classname, #generate_classname_without_spacing, included
#initialize, #prop
#pb_rails
Instance Method Details
#classname ⇒ Object
17
18
19
|
# File 'app/pb_kits/playbook/pb_avatar/avatar.rb', line 17
def classname
generate_classname("pb_avatar_kit", size)
end
|
#handle_img_error ⇒ Object
25
26
27
|
# File 'app/pb_kits/playbook/pb_avatar/avatar.rb', line 25
def handle_img_error
"this.style.display = 'none'"
end
|
#initials ⇒ Object
13
14
15
|
# File 'app/pb_kits/playbook/pb_avatar/avatar.rb', line 13
def initials
name.split.map(&:first).join.downcase
end
|
#online_status_props ⇒ Object
21
22
23
|
# File 'app/pb_kits/playbook/pb_avatar/avatar.rb', line 21
def online_status_props
{ status: status, classname: "size_#{size}" }
end
|