Sha256: 1fe3534a76e36ce1e36fb4dd5c1bdfdbe4323d6b9ff734ae367005206bc99131
Contents?: true
Size: 938 Bytes
Versions: 2
Compression:
Stored size: 938 Bytes
Contents
# frozen_string_literal: true require "action_view" module Playbook module PbContact class Contact include ActionView::Helpers::NumberHelper include Playbook::Props partial "pb_contact/contact" prop :contact_type prop :contact_value def classname generate_classname("pb_contact_kit") end def contact_icon case contact_type when "cell" "mobile" when "home" "phone" when "work" "phone-office" when "email" "envelope" else # "unknown" || "other" "phone" end end def formatted_contact_value if contact_type == "email" contact_value else number_to_phone(formatted_value, area_code: true) end end private def formatted_value contact_value.to_s.gsub(/\D/, "") end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
playbook_ui-2.9.6 | app/pb_kits/playbook/pb_contact/contact.rb |
playbook_ui-2.9.5 | app/pb_kits/playbook/pb_contact/contact.rb |