Skip to content

Commit

Permalink
Also replace FlashMessageComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Sep 19, 2024
1 parent b762b43 commit 3a36ee7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 70 deletions.
5 changes: 3 additions & 2 deletions app/controllers/concerns/op_turbo/component_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ def render_error_flash_message_via_turbo_stream(**kwargs)
update_flash_message_via_turbo_stream(**kwargs.merge(scheme: :danger, icon: :stop))
end

def update_flash_message_via_turbo_stream(component: OpPrimer::BannerMessageComponent, **)
turbo_streams << component.new(**).render_as_turbo_stream(view_context:, action: :flash)
def update_flash_message_via_turbo_stream(message:, component: OpPrimer::BannerMessageComponent, **)
instance = component.new(**).with_content(message)
turbo_streams << instance.render_as_turbo_stream(view_context:, action: :flash)
end

def turbo_streams
Expand Down
61 changes: 0 additions & 61 deletions modules/meeting/app/components/flash_message_component.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
<%=
flex_layout(data: { turbo: true }) do |show_page|
show_page.with_row do
# prototyical usage of Primer's flash message component wrapped in a component which can be updated via turbo stream
# empty initially
# should become part of the application layout once finalized
render(FlashMessageComponent.new)
end

show_page.with_row do
render(Meetings::HeaderComponent.new(meeting: @meeting, project: @project))
end
Expand Down

0 comments on commit 3a36ee7

Please sign in to comment.