Skip to content

Commit ef98851

Browse files
committed
Add expire time to ens banner (#14057)
(cherry picked from e582ba4)
1 parent 9338bf7 commit ef98851

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

src/status_im/ui/screens/home/views.cljs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
[status-im.utils.config :as config]
2727
[quo2.components.text :as quo2.text]
2828
[status-im.qr-scanner.core :as qr-scanner]
29+
[status-im.utils.datetime :as datetime]
2930
[status-im.ui.components.chat-icon.screen :as chat-icon.screen]
3031
[status-im.ui.components.chat-icon.styles :as chat-icon.styles]
3132
[quo2.foundations.colors :as quo2.colors]
@@ -188,6 +189,8 @@
188189
[home-tooltip-view]
189190
[react/view {:height 68}])}])))
190191

192+
(def ens-banner-expire-timestamp 1665010800)
193+
191194
(views/defview communities-and-chats-old []
192195
(views/letsubs [{:keys [items search-filter]} [:home-items]
193196
hide-home-tooltip? [:hide-home-tooltip?]
@@ -207,18 +210,19 @@
207210
:header [:<>
208211
(when (or (seq items) @search-active? (seq search-filter))
209212
[search-input-wrapper-old search-filter (empty? items)])
210-
[information-box/information-box
211-
{:type :informative
212-
:closable? true
213-
:closed? information-box-closed?
214-
:icon :main-icons/info
215-
:style {:margin 20}
216-
:button-label (i18n/label :t/open-dapp2)
217-
:on-button-press #(re-frame/dispatch
218-
[:browser.ui/open-url "https://ens-collect.status.im/"])
219-
:id :ens-banner
220-
:on-close #(re-frame/dispatch [:close-information-box :ens-banner true])}
221-
(i18n/label :t/ens-banner-message)]
213+
(when (< (datetime/timestamp-sec) ens-banner-expire-timestamp)
214+
[information-box/information-box
215+
{:type :informative
216+
:closable? true
217+
:closed? information-box-closed?
218+
:icon :main-icons/info
219+
:style {:margin 20}
220+
:button-label (i18n/label :t/open-dapp2)
221+
:on-button-press #(re-frame/dispatch
222+
[:browser.ui/open-url "https://ens-collect.status.im/"])
223+
:id :ens-banner
224+
:on-close #(re-frame/dispatch [:close-information-box :ens-banner true])}
225+
(i18n/label :t/ens-banner-message)])
222226
(when (and (empty? items)
223227
(or @search-active? (seq search-filter)))
224228
[start-suggestion search-filter])]

0 commit comments

Comments
 (0)