-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Back from the burn, where the hell was I...?
- Loading branch information
Nicholas Barone
committed
Sep 12, 2024
1 parent
a6a4f01
commit 4eea078
Showing
9 changed files
with
99 additions
and
38 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
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
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
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,6 +1,7 @@ | ||
require "storybook/version" | ||
require "storybook/preview" | ||
require "storybook/partial_preview_component" | ||
require "storybook/react_preview_component" | ||
require "storybook/railtie" if defined?(Rails::Railtie) | ||
|
||
module Storybook; end |
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,13 +1,14 @@ | ||
require 'view_component' | ||
require "view_component" | ||
|
||
module Storybook | ||
class PartialPreviewComponent < ViewComponent::Base | ||
slim_template <<~SLIM | ||
= render partial: @partial | ||
= render partial: @partial, locals: @locals | ||
SLIM | ||
|
||
def initialize(partial:) | ||
def initialize(partial:, **locals) | ||
@partial = partial | ||
@locals = locals | ||
end | ||
end | ||
end |
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require "view_component" | ||
require "react_on_rails" | ||
|
||
module Storybook | ||
class ReactPreviewComponent < ViewComponent::Base | ||
include ReactOnRails::Helper | ||
|
||
slim_template <<~SLIM | ||
= react_component @component, props: @props | ||
SLIM | ||
|
||
def initialize(component, **props) | ||
@component = component | ||
@props = props | ||
end | ||
end | ||
end |
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
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