Add expire time to ens banner (#14057)

(cherry picked from e582ba4169)
This commit is contained in:
Parvesh Monu 2022-09-22 14:58:54 +05:30
parent 9338bf71ee
commit ef988517f6
No known key found for this signature in database
GPG Key ID: F399696520817DE9
1 changed files with 16 additions and 12 deletions

View File

@ -26,6 +26,7 @@
[status-im.utils.config :as config]
[quo2.components.text :as quo2.text]
[status-im.qr-scanner.core :as qr-scanner]
[status-im.utils.datetime :as datetime]
[status-im.ui.components.chat-icon.screen :as chat-icon.screen]
[status-im.ui.components.chat-icon.styles :as chat-icon.styles]
[quo2.foundations.colors :as quo2.colors]
@ -188,6 +189,8 @@
[home-tooltip-view]
[react/view {:height 68}])}])))
(def ens-banner-expire-timestamp 1665010800)
(views/defview communities-and-chats-old []
(views/letsubs [{:keys [items search-filter]} [:home-items]
hide-home-tooltip? [:hide-home-tooltip?]
@ -207,18 +210,19 @@
:header [:<>
(when (or (seq items) @search-active? (seq search-filter))
[search-input-wrapper-old search-filter (empty? items)])
[information-box/information-box
{:type :informative
:closable? true
:closed? information-box-closed?
:icon :main-icons/info
:style {:margin 20}
:button-label (i18n/label :t/open-dapp2)
:on-button-press #(re-frame/dispatch
[:browser.ui/open-url "https://ens-collect.status.im/"])
:id :ens-banner
:on-close #(re-frame/dispatch [:close-information-box :ens-banner true])}
(i18n/label :t/ens-banner-message)]
(when (< (datetime/timestamp-sec) ens-banner-expire-timestamp)
[information-box/information-box
{:type :informative
:closable? true
:closed? information-box-closed?
:icon :main-icons/info
:style {:margin 20}
:button-label (i18n/label :t/open-dapp2)
:on-button-press #(re-frame/dispatch
[:browser.ui/open-url "https://ens-collect.status.im/"])
:id :ens-banner
:on-close #(re-frame/dispatch [:close-information-box :ens-banner true])}
(i18n/label :t/ens-banner-message)])
(when (and (empty? items)
(or @search-active? (seq search-filter)))
[start-suggestion search-filter])]