-
-
Notifications
You must be signed in to change notification settings - Fork 927
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lookbook is not loaded in production.
- Loading branch information
1 parent
91fbb8a
commit 7294d3f
Showing
1 changed file
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
Rails.application.config.lookbook.preview_layout = "component_preview" if Rails.env.local? | ||
|
||
module Lookbook::PreviewOverrides | ||
# see https://github.com/ViewComponent/lookbook/issues/584 | ||
def render(component = nil, **args, &block) | ||
if block | ||
super { component.instance_exec component, &block } | ||
else | ||
super | ||
if Rails.env.development? | ||
module Lookbook::PreviewOverrides | ||
# see https://github.com/ViewComponent/lookbook/issues/584 | ||
def render(component = nil, **args, &block) | ||
if block | ||
super { component.instance_exec component, &block } | ||
else | ||
super | ||
end | ||
end | ||
end | ||
end | ||
|
||
Rails.application.configure { Lookbook::Preview.prepend Lookbook::PreviewOverrides } | ||
Rails.application.configure { Lookbook::Preview.prepend Lookbook::PreviewOverrides } | ||
end |