WIP: refactor notifications (#17413)

to accomplish #17288

migrated :

notifications

Issue Opened: A bug has been identified within the activity-logs component and is currently under investigation.
This commit is contained in:
Flavio Fraschetti 2023-09-25 19:04:03 +01:00 committed by GitHub
parent 3082605d1e
commit f12c7401d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 24 deletions

View File

@ -68,8 +68,7 @@
(def ^:private toast-container (quo.theme/with-theme toast-container-internal)) (def ^:private toast-container (quo.theme/with-theme toast-container-internal))
(defn toast (defn toast
[{:keys [icon icon-color title text action undo-duration undo-on-press container-style [{:keys [icon icon-color title text action undo-duration undo-on-press container-style theme user]}]
theme user]}]
(let [context-theme (or theme (quo.theme/get-theme))] (let [context-theme (or theme (quo.theme/get-theme))]
[quo.theme/provider {:theme context-theme} [quo.theme/provider {:theme context-theme}
[toast-container [toast-container
@ -78,7 +77,6 @@
(cond-> (style/icon context-theme) (cond-> (style/icon context-theme)
icon-color icon-color
(assoc :color icon-color))] (assoc :color icon-color))]
user user
[user-avatar/user-avatar user]) [user-avatar/user-avatar user])
:title title :title title

View File

@ -305,9 +305,9 @@
{:name :activity-logs-photos {:name :activity-logs-photos
:component activity-logs-photos/preview-activity-logs-photos} :component activity-logs-photos/preview-activity-logs-photos}
{:name :toast {:name :toast
:component toast/preview-toasts} :component toast/view}
{:name :notification {:name :notification
:component notification/preview-notification}] :component notification/view}]
:onboarding [{:name :small-option-card :onboarding [{:name :small-option-card
:component small-option-card/preview-small-option-card}] :component small-option-card/preview-small-option-card}]
:password [{:name :tips :password [{:name :tips

View File

@ -76,7 +76,7 @@
:duration 3000 :duration 3000
:type :notification}]) :type :notification}])
(defn preview-notification (defn view
[] []
(fn [] (fn []
[preview/preview-container [preview/preview-container

View File

@ -86,22 +86,17 @@
:duration 3000}])} :duration 3000}])}
"update above toast"]]))))) "update above toast"]])))))
(defn preview-toasts (defn view
[] []
(fn [] [preview/preview-container
[preview/preview-container {:component-container-style
[rn/view {:flex-direction :column
{:background-color "#508485" :justify-content :flex-start}}
:flex-direction :column [into
:justify-content :flex-start [rn/view {:style {:flex 1 :padding 16}}
:height 300}] [toast-button-basic]
[into [toast-button-with-undo-action]
[rn/view [toast-button-multiline]
{:flex 1 [toast-button-30s-duration]
:padding 16}] [update-toast-button]
[^{:key :basic} [toast-button-basic] [update-toast-button]]]])
^{:key :with-undo-action} [toast-button-with-undo-action]
^{:key :with-multiline} [toast-button-multiline]
^{:key :30s-duration} [toast-button-30s-duration]
^{:key :upsert}
[update-toast-button]]]]))