Skip to content

Commit

Permalink
Merge de7d0d5 into 6ee3e9e
Browse files Browse the repository at this point in the history
  • Loading branch information
aidewoode committed Dec 6, 2023
2 parents 6ee3e9e + de7d0d5 commit 4248530
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Expand Up @@ -75,7 +75,7 @@ def redirect_back_with_referer_params(fallback_location:)

def render_flash(type: :success, message: "")
flash[type] = message unless message.blank?
turbo_stream.update "turbo-flash", partial: "shared/flash"
turbo_stream.replace "turbo-flash", partial: "shared/flash"
end

private
Expand Down
8 changes: 2 additions & 6 deletions app/views/layouts/application.html.erb
Expand Up @@ -2,9 +2,7 @@
<%= turbo_stream_from "media_sync" %>
<% if native_app? %>
<div id='turbo-flash' class='c-flash'>
<%= render "shared/flash" %>
</div>
<%= render "shared/flash" %>
<main class='u-p-large u-p-small@small'>
<%= yield %>
</main>
Expand All @@ -23,9 +21,7 @@
<div id='js-app' class='o-flex__item o-flex__item--grow-1'>
<div>
<header class='c-nav c-nav--primary u-position-sticky-top'>
<div id='turbo-flash' class='c-flash'>
<%= render "shared/flash" %>
</div>
<%= render "shared/flash" %>
<%= render "shared/search_bar" %>
<%= render "shared/nav_bar" %>
</header>
Expand Down
4 changes: 1 addition & 3 deletions app/views/layouts/plain.html.erb
@@ -1,7 +1,5 @@
<% content_for :body do %>
<div id='turbo-flash' class='c-flash'>
<%= render "shared/flash" %>
</div>
<%= render "shared/flash" %>
<div class='o-flex o-flex--justify-center o-flex--align-center u-vh-100 u-bg-gradient'>
<div class='o-container o-container--extra-narrow u-w-100 u-mx-small u-bg-primary u-px-small u-py-large u-border-shadow u-border-radius-large'>
<div class='u-mb-large u-text-align-center'>
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_flash.html.erb
@@ -1,4 +1,4 @@
<div class='<%= "u-display-none" if native_app? %>'>
<div id='turbo-flash' data-turbo-temporary class='c-flash <%= "u-display-none" if native_app? %>'>
<% flash.each do |key, value| %>
<div class='o-animation-fadeInDown c-flash__body <%= "c-flash__body--#{key}" %>' data-controller='flash flash-bridge'>
<%= h value %>
Expand Down

0 comments on commit 4248530

Please sign in to comment.