code refactor

This commit is contained in:
jo-mut 2024-05-27 00:55:42 +02:00
parent 539b7bbff4
commit 31d0c14247
No known key found for this signature in database
GPG Key ID: 76AE8CD103294A70
1 changed files with 10 additions and 13 deletions

View File

@ -199,24 +199,21 @@
([component] (show-overlay component {}))
([component opts]
(navigation/dissmiss-overlay component)
(let [theme (rf/sub [:theme])]
(let [theme (rf/sub [:theme])
[rnn-status-bar _ nav-bar-color _] (get-status-nav-color component theme)]
(navigation/show-overlay
{:component {:name component
:id component
:options (merge (options/statusbar-and-navbar-options theme nil nil)
{:layout {:componentBackgroundColor :transparent
:orientation ["portrait"]}
:overlay {:interceptTouchOutside true
:handleKeyboardEvents true}}
opts)}}))))
:options (merge
(options/statusbar-and-navbar-options theme rnn-status-bar nav-bar-color)
{:layout {:componentBackgroundColor :transparent
:orientation ["portrait"]}
:overlay {:interceptTouchOutside true
:handleKeyboardEvents true}}
opts)}}))))
(rf/reg-fx :show-toasts
(fn [[view-id theme]]
(let [[rnn-status-bar nav-bar-color] (get-status-nav-color view-id theme)]
(show-overlay "toasts"
(assoc (options/statusbar-and-navbar-options nil rnn-status-bar nav-bar-color)
:overlay
{:interceptTouchOutside false})))))
(fn [] (show-overlay "toasts")))
(rf/reg-fx :hide-toasts
(fn [] (navigation/dissmiss-overlay "toasts")))