8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/helpers/spree/admin/stores_helper.rb', line 8
def store_admin_icon(store, opts = {})
opts[:class] ||= 'rounded-md bg-white border store-icon'
opts[:height] ||= DEFAULT_ICON_SIZE
opts[:width] ||= DEFAULT_ICON_SIZE
store ||= current_store
return unless store
Rails.cache.fetch(["#{store.cache_key_with_version}/admin_icon", opts.to_param]) do
if store.logo&.attached? && store.logo&.variable?
spree_image_tag(store.logo, class: opts[:class], width: opts[:width], height: opts[:height])
elsif store.respond_to?(:favicon_image) && store.favicon_image&.attached? && store.favicon_image&.variable?
spree_image_tag(store.favicon_image, class: opts[:class], width: opts[:width], height: opts[:height])
else
first_letter_icon(store.name, opts)
end
end
end
|