From e582ba4169c11a6711399d2569018acbef9afd28 Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Thu, 22 Sep 2022 14:58:54 +0530 Subject: [PATCH] Add expire time to ens banner (#14057) --- src/status_im/ui/screens/home/views.cljs | 28 ++++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/status_im/ui/screens/home/views.cljs b/src/status_im/ui/screens/home/views.cljs index dcca446021..c10a305d53 100644 --- a/src/status_im/ui/screens/home/views.cljs +++ b/src/status_im/ui/screens/home/views.cljs @@ -26,6 +26,7 @@ [status-im.utils.config :as config] [quo2.components.markdown.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])]