5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/matestack/ui/bootstrap/components/avatar.rb', line 5
def response
if context.text.present? && context.img_path.nil?
div class: "rounded-circle bg-#{context.bg_variant || 'primary'} text-#{context.text_variant || 'white'} text-center p-2 #{context.bs_class}",
style: "height: #{height}px; width: #{width}px; display: inline-block;" do
plain context.text
end
else
div class: "rounded-circle text-#{context.text_variant || 'white'} text-center p-2 #{context.bs_class}",
style: "height: #{height}px; width: #{width}px; display: inline-block; background-image: url(#{context.img_path}); background-size: contain;" do
plain context.text
end
end
end
|