From 53ca45a67af52692fbdab7dd7729659a85f97957 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Thu, 17 Sep 2026 20:24:56 +0300 Subject: [PATCH] adjust flash --- app/javascript/elements/flash_message.js | 10 +++------- app/views/shared/_flash.html.erb | 21 +++++++++------------ 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/app/javascript/elements/flash_message.js b/app/javascript/elements/flash_message.js index 9da5eb7db..d3dca79e9 100644 --- a/app/javascript/elements/flash_message.js +++ b/app/javascript/elements/flash_message.js @@ -1,6 +1,4 @@ -import { actionable } from '@github/catalyst/lib/actionable' - -export default actionable(class extends HTMLElement { +export default class extends HTMLElement { connectedCallback () { this.addEventListener('turbo:morph-element', this.onMorph) @@ -32,9 +30,7 @@ export default actionable(class extends HTMLElement { this.closeTimeout = setTimeout(this.close, 2000) } - close = (event) => { - event?.preventDefault() - + close = () => { clearTimeout(this.closeTimeout) this.hideAnimation = this.animate([ @@ -44,4 +40,4 @@ export default actionable(class extends HTMLElement { this.hideAnimation.onfinish = () => this.remove() } -}) +} diff --git a/app/views/shared/_flash.html.erb b/app/views/shared/_flash.html.erb index 9adbfff0b..e4507a7e6 100644 --- a/app/views/shared/_flash.html.erb +++ b/app/views/shared/_flash.html.erb @@ -2,19 +2,16 @@ <% else %> -
-
-
- <% if flash[:notice] %> - <%= svg_icon('info_circle', class: 'stroke-info flex-none w-6 h-6') %> - <% else %> - <%= svg_icon('exclamation_circle', class: 'stroke-error flex-none w-6 h-6') %> - <% end %> -
- <%= flash[:notice] || flash[:alert] %> -
+
+
+ <% if flash[:notice] %> + <%= svg_icon('info_circle', class: 'stroke-info flex-none w-6 h-6') %> + <% else %> + <%= svg_icon('exclamation_circle', class: 'stroke-error flex-none w-6 h-6') %> + <% end %> +
+ <%= flash[:notice] || flash[:alert] %>
-