Skip to content

Commit e4601ae

Browse files
committed
Take before_render method into the class
1 parent e2bb7dc commit e4601ae

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
<%= render(@border_box) %>
2-
<span>HELLO</span>

app/components/primer/open_project/collapsible_border_box.rb

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
module Primer
44
module OpenProject
5-
# Add a general description of component here
6-
# Add additional usage considerations or best practices that may aid the user to use the component correctly.
7-
# @accessibility Add any accessibility considerations
85
class CollapsibleBorderBox < Primer::Component
96
status :open_project
107

@@ -17,20 +14,14 @@ def initialize(**system_arguments)
1714

1815
delegate :body?, :body, :with_body, :with_body_content,
1916
:footer?, :footer, :with_footer, :with_footer_content,
20-
:rows?, :rows, :with_row, :with_row_content,
17+
:row?, :row, :with_row, :with_row_content,
2118
to: :@border_box
22-
end
23-
24-
private
2519

26-
def before_render
27-
content
28-
end
20+
private
2921

30-
def render?
31-
puts "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
32-
puts body.present?
33-
true
22+
def before_render
23+
content
24+
end
3425
end
3526
end
3627
end

previews/primer/open_project/collapsible_border_box_preview.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ class CollapsibleBorderBoxPreview < ViewComponent::Preview
1515
def default
1616
render(Primer::OpenProject::CollapsibleBorderBox.new) do |component|
1717
component.with_body { "Body" }
18+
component.with_row { "Row 1" }
19+
component.with_row { "Row 2" }
20+
component.with_row { "Row 3" }
21+
component.with_footer { "Footer" }
1822
end
1923
end
2024
end

0 commit comments

Comments
 (0)