File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ import { application } from "controllers/application"
33import ClickableController from "controllers/clickable_controller"
44application . register ( "clickable" , ClickableController )
55
6+ import FlashController from "controllers/flash_controller"
7+ application . register ( "flash" , FlashController )
8+
69import DebugTurboController from "controllers/debug_turbo_controller"
710application . register ( "debug-turbo" , DebugTurboController )
811
Original file line number Diff line number Diff line change 11- flash.each do |type , message |
22 - if type.to_sym == :notice
33 - color_classes = " bg-blue-100 border-blue-500"
4- - elsif type.to_sym == :error
4+ - elsif type.to_sym.in?([ :error , :alert ])
55 - color_classes = " bg-red-100 border-red-500"
6+ - else
7+ - color_classes = " bg-white"
68
79 div class =" absolute border-t-4 rounded-b px-4 py-3 shadow-md #{color_classes} right-10" role =" alert" data-controller =" flash" data-action =" click->flash#hide"
810 div class =" flex"
911 div class =" py-1"
1012 = icon(:bell )
11- / svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-blue-500 mr-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"
12- path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"
1313 div
14- p class =" font-bold" = t(type)
1514 p = message
You can’t perform that action at this time.
0 commit comments