app/helpers/lookbook/component_helper.rb in lookbook-1.0.0.beta.2 vs app/helpers/lookbook/component_helper.rb in lookbook-1.0.0.beta.3
- old
+ new
@@ -1,8 +1,12 @@
module Lookbook
module ComponentHelper
COMPONENT_CLASSES = {} # cache for constantized references
+ def icon(name, **attrs)
+ render Lookbook::Icon::Component.new(name: name, **attrs)
+ end
+
def render_component(ref, **attrs, &block)
klass = component_class(ref)
comp = attrs.key?(:content) ? klass.new(**attrs.except(:content)).with_content(attrs[:content]) : klass.new(**attrs)
render comp, &block
end