Sha256: dac259ac479850bb1f56bd4f2528e4636a940523ef8ff1c316a0f45baa8ba76a
Contents?: true
Size: 818 Bytes
Versions: 69
Compression:
Stored size: 818 Bytes
Contents
# frozen_string_literal: true module Playbook module PbAvatar class Avatar < Playbook::KitBase prop :image_url, type: Playbook::Props::String prop :image_alt, type: Playbook::Props::String, default: "" prop :name, type: Playbook::Props::String, default: "" prop :size, type: Playbook::Props::Enum, values: %w[xs sm md base lg xl], default: "md" prop :status def initials name.split.map(&:first).join.downcase end def classname generate_classname("pb_avatar_kit", size) end def online_status_props { status: status, classname: "size_#{size}" } end def handle_img_error "this.style.display = 'none'" end end end end
Version data entries
69 entries across 69 versions & 1 rubygems