-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 229-all-patterns-same-route
- Loading branch information
Showing
13 changed files
with
739 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
client/web/src/flybot/client/web/core/dom/common/error.cljs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
client/web/src/flybot/client/web/core/dom/page/notifications.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
(ns flybot.client.web.core.dom.page.notifications | ||
"Rendering app notifications as pop-up (\"toast\") notifications in the DOM." | ||
(:require [cljsjs.react-toastify] | ||
[re-frame.core :as rf])) | ||
|
||
(def toast-notification-container | ||
"A container for pop-up notifications, with default settings. | ||
This container should be stacked above other HTML elements (either by | ||
using the `z-index` property or by declaring it last) so that notifications | ||
properly cover them." | ||
[:> (-> (.-ToastContainer js/ReactToastify) | ||
js->clj | ||
(update "defaultProps" #(merge % {"position" "bottom-center" | ||
"hideProgressBar" true | ||
"newestOnTop" true | ||
"pauseOnFocusLoss" false | ||
"pauseOnHover" false | ||
"closeButton" false})) | ||
clj->js)]) | ||
|
||
(defn toast-notification-subscription | ||
[] | ||
(let [notification @(rf/subscribe [:subs/pattern {:app/notification '?x}])] | ||
(when notification | ||
(rf/dispatch [:evt.app/toast-notify notification])))) | ||
|
||
(defn toast-notification-comp | ||
[] | ||
[:<> | ||
[toast-notification-subscription] | ||
toast-notification-container]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.