Add Notifications UI #455

Closed
jclusso wants to merge 1 commits from notification_ui into main
jclusso commented 2024-02-13 14:26:14 +08:00 (Migrated from github.com)

Resolves #447
/claim #447

Some key things to note:

  • Adds notifications UI
  • This implementation supports both flash on redirects (ex: redirect_to(root_path, alert: "Something went wrong") as well as flash on turbo stream responses (ex: turbo_stream.flash(alert: "Something went wrong"))
  • Replaces flash helper in auth views

https://github.com/maybe-finance/maybe/assets/622516/3b272e16-20f3-4a20-9684-96046814faf7

Resolves #447 /claim #447 Some key things to note: - Adds notifications UI - This implementation supports both flash on redirects (ex: `redirect_to(root_path, alert: "Something went wrong")` as well as flash on turbo stream responses (ex: `turbo_stream.flash(alert: "Something went wrong")`) - Replaces flash helper in auth views https://github.com/maybe-finance/maybe/assets/622516/3b272e16-20f3-4a20-9684-96046814faf7
algora-pbc[bot] commented 2024-02-13 14:26:20 +08:00 (Migrated from github.com)
💵 To receive payouts, [sign up on Algora](https://console.algora.io/auth/signup), [link your Github account](https://console.algora.io/onboarding/solver) and [connect with Stripe/Alipay](https://console.algora.io/onboarding/solver).
jclusso (Migrated from github.com) reviewed 2024-02-13 15:08:05 +08:00
@@ -207,0 +208,4 @@
'stroke-fill': {
to: { 'stroke-dashoffset': 0 },
},
},
jclusso (Migrated from github.com) commented 2024-02-13 15:08:05 +08:00

Credit to @JoshAntBrown since I stole this from #449. I'm not crazy about having to add something to the tailwind config, so if there is a better way to do this, let me know.

Credit to @JoshAntBrown since I stole this from #449. I'm not crazy about having to add something to the tailwind config, so if there is a better way to do this, let me know.
mogery commented 2024-02-13 17:32:40 +08:00 (Migrated from github.com)

Awesome, thorough code! 👏🏻

Awesome, thorough code! 👏🏻
henrikbjorn (Migrated from github.com) reviewed 2024-02-13 19:42:34 +08:00
@@ -0,0 +2,4 @@
def flash_message(flash)
messages = flash.map do |type, message|
turbo_stream_action_tag(:flash_message, type: type, message: message)
end.join.html_safe
henrikbjorn (Migrated from github.com) commented 2024-02-13 19:42:34 +08:00
You can also use `.safe_join` https://api.rubyonrails.org/classes/ActionView/Helpers/OutputSafetyHelper.html#method-i-safe_join

Pull request closed

Sign in to join this conversation.