Replace all usage of topbar with Quo

QR

Invert border boolean

Update e2e

Fix another e2e

Signed-off-by: Gheorghe Pinzaru <feross95@gmail.com>
This commit is contained in:
Gheorghe Pinzaru 2020-08-06 11:48:12 +03:00
parent 62fe9f3d6a
commit 4e44bed8d6
No known key found for this signature in database
GPG Key ID: C9A094959935A952
62 changed files with 386 additions and 682 deletions

View File

@ -58,6 +58,7 @@
:offset @offset})}
[header/header (merge
{:get-layout (fn [el l] (swap! layout assoc el l))
:border-bottom false
:title-component [animated/view {:style (title-style @layout)}
[extended-header {:value y
:animation animation

View File

@ -10,13 +10,16 @@
(def header-height 56)
(defn header-wrapper-style [{:keys [height border-bottom]}]
(defn header-wrapper-style [{:keys [height border-bottom background]}]
(merge
(:x-tiny spacing/padding-horizontal)
{:background-color (:ui-background @colors/theme)
:height height}
(when background
{:background-color background})
(when border-bottom
{:border-bottom-width 1
:border-bottom-color (:ui-02 @colors/theme)})))
:border-bottom-color (:ui-01 @colors/theme)})))
(def absolute-fill {:position :absolute
:top 0
@ -49,9 +52,10 @@
(case title-align
:left {:left (:width left)
:right (:width right)}
{:align-items :center
:left (max (:width left) (:width right))
:right (max (:width left) (:width right))})))
{:align-items :center
:justify-content :center
:left (max (:width left) (:width right))
:right (max (:width left) (:width right))})))
(def header-actions-style
(merge
@ -59,7 +63,7 @@
:flex-direction :row
:align-items :center
:justify-content :center}
(:tiny spacing/padding-horizontal)))
(:x-tiny spacing/padding-horizontal)))
(def header-action-placeholder
{:width (:base spacing/spacing)})
@ -68,8 +72,9 @@
:justify-content :center
:flex 1})
(defn header-action [{:keys [icon label on-press accessibility-label]}]
[button/button (merge {:on-press on-press}
(defn header-action [{:keys [icon label on-press disabled accessibility-label]}]
[button/button (merge {:on-press on-press
:disabled disabled}
(cond
icon {:type :icon
:theme :icon}
@ -103,19 +108,20 @@
:number-of-lines 1}
title]
[text/text {:weight :regular
:color :secondary
:number-of-lines 1}
subtitle]]
title [text/text {:weight :bold
:number-of-lines 2
:number-of-lines 0
:align title-align
:size :large}
title])])
(defn header []
(let [layout (reagent/atom {:left {:width 8
(defn header [{:keys [left-width right-width]}]
(let [layout (reagent/atom {:left {:width (or left-width 8)
:height header-height}
:right {:width 8
:right {:width (or right-width 8)
:height header-height}
:title {:width 0
:height header-height}})
@ -130,11 +136,14 @@
:height height}))))]
(fn [{:keys [left-accessories left-component border-bottom
right-accessories right-component insets get-layout
title subtitle title-component style title-align]
:or {title-align :center}}]
title subtitle title-component style title-align
background]
:or {title-align :center
border-bottom true}}]
(let [status-bar-height (get insets :top 0)
height (+ header-height status-bar-height)]
[animated/view {:style (header-wrapper-style {:height height
:background background
:border-bottom border-bottom})}
[rn/view {:pointer-events :box-none
:height status-bar-height}]

View File

@ -29,7 +29,7 @@
(let [custom? (= (get-in manage-network [:chain :value]) :custom)]
[react/view styles/container
[react/keyboard-avoiding-view components.styles/flex
[topbar/topbar {:title :t/add-network}]
[topbar/topbar {:title (i18n/label :t/add-network)}]
[react/scroll-view
[react/view styles/edit-network-view
[react/view {:padding-vertical 8}

View File

@ -19,7 +19,7 @@
custom? (seq (filter #(= (:id %) id) (:custom networks)))]
[react/view st/container
[react/view components.styles/flex
[topbar/topbar {:title :t/network-details}]
[topbar/topbar {:title (i18n/label :t/network-details)}]
[react/view components.styles/flex
[network-settings/network-badge
{:name name

View File

@ -45,9 +45,10 @@
(views/letsubs [current-network [:networks/current-network]
networks [:get-networks]]
[react/view components.styles/flex
[topbar/topbar {:title :t/network-settings
:accessories [{:icon :main-icons/add
:handler #(re-frame/dispatch [::network/add-network-pressed])}]}]
[topbar/topbar {:title (i18n/label :t/network-settings)
:right-accessories
[{:icon :main-icons/add
:on-press #(re-frame/dispatch [::network/add-network-pressed])}]}]
[react/view styles/wrapper
[list/section-list {:sections [{:title (i18n/label :t/main-networks)
:key :mainnet
@ -60,4 +61,4 @@
:data (:custom networks)}]
:key-fn :id
:default-separator? true
:render-fn (render-network current-network)}]]]))
:render-fn (render-network current-network)}]]]))

View File

@ -619,6 +619,13 @@
(not group-chat)
(assoc :show-input? true)))))
(re-frame/reg-sub
:current-chat/metadata
:<- [:chats/current-raw-chat]
(fn [current-chat]
(select-keys current-chat
[:public? :group-chat :chat-id :chat-name :color])))
(re-frame/reg-sub
:current-chat/one-to-one-chat?
:<- [:chats/current-raw-chat]

View File

@ -22,7 +22,7 @@
{:margin-bottom (:tiny spacing/spacing)
:height (:small spacing/spacing)
:border-bottom-width 1
:border-bottom-color (:ui-02 @colors/theme)})
:border-bottom-color (:ui-01 @colors/theme)})
(defn header-text []
{:padding-left (:base spacing/spacing)

View File

@ -1,24 +0,0 @@
(ns status-im.ui.components.toolbar.actions
(:require [re-frame.core :as re-frame]))
(defn opts [options]
{:icon :main-icons/more
:options options})
(defn back [handler]
{:icon :main-icons/arrow-left
:handler handler
:accessibility-label :back-button})
(def default-handler #(re-frame/dispatch [:navigate-back]))
(def default-back
(back default-handler))
(defn close [handler]
{:icon :main-icons/close
:handler handler
:accessibility-label :done-button})
(def default-close
(close default-handler))

View File

@ -1,24 +0,0 @@
(ns status-im.ui.components.toolbar.styles
(:require [status-im.ui.components.colors :as colors]))
(def toolbar-height 56)
(def toolbar-title-container
{:justify-content :center
:align-items :center
:flex-direction :column})
(def toolbar-title-text
{:typography :title-bold
:text-align :center})
(def touchable-area
{:width 56
:height 56
:justify-content :center
:align-items :center})
(def item-text
{:color colors/blue})
(def toolbar-text-action-disabled
{:color colors/gray})

View File

@ -1,150 +0,0 @@
(ns status-im.ui.components.toolbar.view
(:require [re-frame.core :as re-frame]
[status-im.ui.components.colors :as colors]
[status-im.ui.components.icons.vector-icons :as vector-icons]
[status-im.ui.components.list-selection :as list-selection]
[status-im.ui.components.react :as react]
[status-im.ui.components.toolbar.actions :as actions]
[status-im.ui.components.toolbar.styles :as styles]
[status-im.utils.core :as utils]))
;; Navigation item
(defn nav-item
[{:keys [handler accessibility-label style] :or {handler #(re-frame/dispatch [:navigate-back])}} item]
[react/touchable-highlight
(merge {:on-press handler
:style styles/touchable-area}
(when accessibility-label
{:accessibility-label accessibility-label}))
[react/view {:style style}
item]])
(defn nav-button
[{:keys [icon icon-opts] :as props}]
[nav-item props
[vector-icons/icon icon icon-opts]])
(defn nav-text
([text] (nav-text nil text))
([{:keys [handler] :as props} text]
[react/touchable-highlight {:on-press (or handler #(re-frame/dispatch [:navigate-back]))}
[react/text (utils/deep-merge {:style styles/item-text}
props)
text]]))
(def default-nav-back [nav-button actions/default-back])
(def default-nav-close [nav-button actions/default-close])
;; Content
(defn content-title
([title] (content-title nil title))
([title-style title]
(content-title title-style title nil nil))
([title-style title subtitle-style subtitle]
(content-title title-style title subtitle-style subtitle nil))
([title-style title subtitle-style subtitle additional-text-props]
[react/view {:style styles/toolbar-title-container}
[react/text (merge {:style (merge styles/toolbar-title-text title-style)
:numberOfLines 1
:ellipsizeMode :tail}
additional-text-props) title]
(when subtitle
[react/text {:style subtitle-style}
subtitle])]))
;; Actions
(defn text-action [{:keys [style handler disabled? accessibility-label]} title]
[react/touchable-highlight {:on-press (when-not disabled?
handler)
:style styles/touchable-area}
[react/text (cond-> {:style (merge styles/item-text
style
(when disabled?
styles/toolbar-text-action-disabled))}
accessibility-label
(assoc :accessibility-label accessibility-label))
title]])
(def blank-action [react/view {:style {:flex 1}}])
(defn- icon-action [icon {:keys [overlay-style] :as icon-opts} handler]
[react/touchable-highlight {:on-press handler
:style styles/touchable-area}
[react/view
(when overlay-style
[react/view overlay-style])
[vector-icons/icon icon icon-opts]]])
(defn- option-actions [icon icon-opts options]
[icon-action icon icon-opts
#(list-selection/show {:options options})])
(defn actions [v]
[react/view {:style {:flex-direction :row}}
(for [{:keys [image icon icon-opts options handler]} v]
(with-meta
(cond (= image :blank)
blank-action
options
[option-actions icon icon-opts options]
:else
[icon-action icon icon-opts handler])
{:key (str "action-" (or image icon))}))])
;;TODO remove
(defn toolbar
([props nav-item content-item] (toolbar props nav-item content-item nil))
([{:keys [style border-bottom-color transparent? browser? chat?]}
nav-item
content-item
action-items]
[react/view {:style (cond-> {:height styles/toolbar-height}
;; i.e. for qr code scanner
(not transparent?)
(assoc :border-bottom-color (or border-bottom-color
colors/gray-lighter)
:border-bottom-width 1)
transparent?
(assoc :background-color :transparent
:z-index 1)
:always
(merge style))}
(when content-item
(cond
browser?
content-item
chat?
[react/view
{:position :absolute
:right 56
:left 56
:top 10}
content-item]
:else
[react/view {:position :absolute
:left 56
:right 56
:height styles/toolbar-height
:justify-content :center
:align-items :center}
content-item]))
(when nav-item
[react/view {:style {:position :absolute
:left 0
:height styles/toolbar-height
:justify-content :center
:align-items :center}}
nav-item])
[react/view {:position :absolute
:right 0
:height styles/toolbar-height
:justify-content :center
:align-items :center}
action-items]]))

View File

@ -1,62 +1,37 @@
(ns status-im.ui.components.topbar
(:require [status-im.ui.components.react :as react]
[re-frame.core :as re-frame]
[status-im.ui.components.colors :as colors]
[reagent.core :as reagent]
[quo.core :as quo]
[status-im.utils.label :as utils.label]))
(:require [re-frame.core :as re-frame]
[quo.core :as quo]))
(defn default-navigation [modal?]
{:icon (if modal? :main-icons/close :main-icons/arrow-left)
:accessibility-label :back-button
:handler #(re-frame/dispatch [:navigate-back])})
(def default-button-width 48)
(defn container [style title-padding & children]
(into []
(concat
[react/view {:style style
:on-layout #(reset! title-padding (max (-> ^js % .-nativeEvent .-layout .-width)
@title-padding))}]
children)))
(defn default-navigation [modal? {:keys [on-press label icon]}]
(cond-> {:icon (if modal? :main-icons/close :main-icons/arrow-left)
:accessibility-label :back-button
:on-press #(re-frame/dispatch [:navigate-back])}
on-press
(assoc :on-press on-press)
(defn button [value nav?]
(let [{:keys [handler icon label accessibility-label]} value]
[react/view {:padding-horizontal (if nav? 8 0)}
[quo/button (merge {:on-press #(when handler (handler))}
(cond
icon {:type :icon
:theme :icon}
label {:type :secondary})
(when accessibility-label
{:accessibility-label accessibility-label}))
(cond
icon icon
label (utils.label/stringify label))]]))
icon
(assoc :icon icon)
(def default-title-padding 16)
;; TODO(Ferossgp): Tobbar should handle safe area
(defn topbar [{:keys [initial-title-padding]}]
(let [title-padding (reagent/atom (or initial-title-padding default-title-padding))]
(fn [& [{:keys [title navigation accessories show-border? modal? content]}]]
(let [navigation (or navigation (default-navigation modal?))]
[react/view (cond-> {:height 56 :align-items :center :flex-direction :row}
show-border?
(assoc :border-bottom-width 1 :border-bottom-color colors/gray-lighter))
(when-not (= navigation :none)
[container {} title-padding
[button navigation true]])
[react/view {:flex 1}]
(when accessories
[container {:flex-direction :row :padding-right 6} title-padding
(for [value accessories]
^{:key value}
[button value false])])
(when content
[react/view {:position :absolute :left @title-padding :right @title-padding
:top 0 :bottom 0}
content])
(when title
[react/view {:position :absolute :left @title-padding :right @title-padding
:top 0 :bottom 0 :align-items :center :justify-content :center}
[react/text {:style {:typography :title-bold :text-align :center} :number-of-lines 2}
(utils.label/stringify title)]])]))))
label
(dissoc :icon)
label
(assoc :label label)))
(defn topbar [{:keys [navigation use-insets right-accessories modal? content]
:as props}]
(let [navigation (if (= navigation :none)
nil
[(default-navigation modal? navigation)])]
[quo/safe-area-consumer
(fn [insets]
[quo/header (merge {:left-accessories navigation
:title-component content
:insets (when use-insets insets)
:left-width (when navigation
default-button-width)}
props
(when (seq right-accessories)
{:right-accessories right-accessories}))])]))

View File

@ -14,7 +14,7 @@
(views/letsubs [app-version [:get-app-short-version]
node-version [:get-app-node-version]]
[react/view {:flex 1 :background-color colors/white}
[topbar/topbar {:title :t/about-app}]
[topbar/topbar {:title (i18n/label :t/about-app)}]
[react/scroll-view
[quo/list-item
{:size :small

View File

@ -64,13 +64,14 @@
{:keys [state ens-name public-key error]} [:contacts/new-identity]]
[react/view {:style {:flex 1}}
[topbar/topbar
{:title :t/new-chat
{:title (i18n/label :t/new-chat)
:modal? true
:accessories [{:icon :qr
:accessibility-label :scan-contact-code-button
:handler #(re-frame/dispatch [::qr-scanner/scan-code
{:title (i18n/label :t/new-contact)
:handler :contact/qr-code-scanned}])}]}]
:right-accessories
[{:icon :qr
:accessibility-label :scan-contact-code-button
:handler #(re-frame/dispatch [::qr-scanner/scan-code
{:title (i18n/label :t/new-contact)
:handler :contact/qr-code-scanned}])}]}]
[react/view {:flex-direction :row
:padding 16}
[react/view {:flex 1

View File

@ -9,7 +9,6 @@
[status-im.ui.components.topbar :as topbar]
[status-im.ui.screens.add-new.new-public-chat.db :as db]
[status-im.chat.models :as chat.models]
[status-im.ui.components.styles :as components.styles]
[status-im.ui.components.icons.vector-icons :as icons])
(:require-macros [status-im.utils.views :as views]))
@ -80,8 +79,9 @@
(views/defview new-public-chat []
(views/letsubs [topic [:public-group-topic]
error [:public-chat.new/topic-error-message]]
[react/view components.styles/flex
[topbar/topbar {:title :t/new-public-group-chat :modal? true}]
[react/view {:style {:flex 1}}
[topbar/topbar {:title (i18n/label :t/new-public-group-chat)
:modal? true}]
[react/scroll-view {:style {:flex 1}}
[react/view {:padding-horizontal 16}
[react/view {:align-items :center :padding-vertical 8}
@ -93,16 +93,16 @@
[react/view {:margin-top 32}
(for [[section chats] (chat.models/chats)]
[react/view
[react/view {:margin-right 16 :padding-left 16 :padding-vertical 3
:border-bottom-width 1 :border-bottom-color colors/gray-lighter
:border-top-width 1 :border-top-color colors/gray-lighter
:border-right-width 1 :border-right-color colors/gray-lighter
[react/view {:margin-right 16 :padding-left 16 :padding-vertical 3
:border-bottom-width 1 :border-bottom-color colors/gray-lighter
:border-top-width 1 :border-top-color colors/gray-lighter
:border-right-width 1 :border-right-color colors/gray-lighter
:border-bottom-right-radius 14 :border-top-right-radius 14}
[quo/text {:weight :medium} section]]
[react/view {:flex-direction :row :flex-wrap :wrap :margin-vertical 8 :padding-horizontal 16}
(let [lang-topic (get-language-topic)
chats (if (and (= section-featured section) lang-topic)
(conj chats lang-topic)
chats)]
chats (if (and (= section-featured section) lang-topic)
(conj chats lang-topic)
chats)]
(for [chat chats]
(render-topic chat)))]])]]]))

View File

@ -128,7 +128,7 @@
current-log-level [:log-level/current-log-level]
current-fleet [:fleets/current-fleet]]
[react/view {:flex 1}
[topbar/topbar {:title :t/advanced}]
[topbar/topbar {:title (i18n/label :t/advanced)}]
[list/flat-list
{:data (flat-list-data
{:network-name network-name

View File

@ -21,9 +21,9 @@
(views/defview appearance []
(views/letsubs [{:keys [appearance]} [:multiaccount]]
[react/view {:flex 1}
[topbar/topbar {:title :t/appearance :show-border? true}]
[topbar/topbar {:title (i18n/label :t/appearance)}]
[quo/list-header (i18n/label :t/preference)]
[react/view {:flex-direction :row :flex 1 :padding-horizontal 8
[react/view {:flex-direction :row :flex 1 :padding-horizontal 8
:justify-content :space-between :margin-top 16}
[button :t/light :theme-light 1 (= 1 appearance)]
[button :t/dark :theme-dark 2 (= 2 appearance)]

View File

@ -29,7 +29,7 @@
is-valid? (empty? validation-errors)
invalid-url? (contains? validation-errors :url)]
[react/keyboard-avoiding-view {:flex 1}
[topbar/topbar {:title (if id :t/bootnode-details :t/add-bootnode)}]
[topbar/topbar {:title (i18n/label (if id :t/bootnode-details :t/add-bootnode))}]
[react/scroll-view {:keyboard-should-persist-taps :handled}
[react/view styles/edit-bootnode-view
[react/view {:padding-vertical 8}

View File

@ -1,6 +1,7 @@
(ns status-im.ui.screens.bootnodes-settings.views
(:require-macros [status-im.utils.views :as views])
(:require [re-frame.core :as re-frame]
[status-im.i18n :as i18n]
[status-im.ui.components.list.views :as list]
[status-im.ui.components.react :as react]
[status-im.ui.screens.profile.components.views :as profile.components]
@ -23,10 +24,11 @@
(views/letsubs [bootnodes-enabled [:custom-bootnodes/enabled?]
bootnodes [:custom-bootnodes/network-bootnodes]]
[react/view {:flex 1}
[topbar/topbar {:title :t/bootnodes-settings
:accessories [{:icon :main-icons/add
:accessibility-label :add-bootnode
:handler #(navigate-to-add-bootnode nil)}]}]
[topbar/topbar {:title (i18n/label :t/bootnodes-settings)
:right-accessories
[{:icon :main-icons/add
:accessibility-label :add-bootnode
:on-press #(navigate-to-add-bootnode nil)}]}]
[react/view styles/switch-container
[profile.components/settings-switch-item
{:label-kw :t/bootnodes-enabled

View File

@ -39,11 +39,9 @@
:max-height 36
:background-color colors/gray-lighter
:padding-horizontal 10
:margin-right 16
:align-items :center
:align-self :center
:margin-top 10
:margin-left 56})
:margin-top 10})
(def url-input
{:flex 1

View File

@ -10,8 +10,7 @@
[status-im.ui.components.icons.vector-icons :as icons]
[status-im.ui.components.react :as react]
[status-im.ui.components.styles :as components.styles]
[status-im.ui.components.toolbar.actions :as actions]
[status-im.ui.components.toolbar.view :as toolbar.view]
[status-im.ui.components.topbar :as topbar]
[status-im.ui.components.tooltip.views :as tooltip]
[status-im.ui.components.webview :as components.webview]
[status-im.ui.screens.browser.accounts :as accounts]
@ -51,15 +50,17 @@
[icons/icon :main-icons/refresh]])]))
(defn toolbar [error? url url-original browser browser-id url-editing? unsafe?]
[toolbar.view/toolbar
{:browser? true}
[toolbar.view/nav-button
(actions/close (fn []
(debounce/clear :browser/navigation-state-changed)
(re-frame/dispatch [:navigate-back])
(when error?
(re-frame/dispatch [:browser.ui/remove-browser-pressed browser-id]))))]
[toolbar-content url url-original browser url-editing? unsafe?]])
[topbar/topbar
{:navigation {:icon :main-icons/close
:on-press (fn []
(debounce/clear :browser/navigation-state-changed)
(re-frame/dispatch [:navigate-back])
(when error?
(re-frame/dispatch [:browser.ui/remove-browser-pressed browser-id])))}
:title-align :left
:title-component
[react/view {:flex 1}
[toolbar-content url url-original browser url-editing? unsafe?]]}])
(defn- web-view-error [_ _ desc]
(reagent/as-element

View File

@ -30,22 +30,18 @@
[status-im.ui.screens.chat.components.input :as components]
[status-im.ui.screens.chat.message.datemark :as message-datemark]))
(defn topbar [current-chat]
[topbar/topbar
{:content [toolbar-content/toolbar-content-view]
:show-border? true
:initial-title-padding 56
:navigation {:icon :main-icons/arrow-left
:accessibility-label :back-button
:handler
#(re-frame/dispatch [:navigate-to :home])}
:accessories [{:icon :main-icons/more
:accessibility-label :chat-menu-button
:handler
#(re-frame/dispatch [:bottom-sheet/show-sheet
{:content (fn []
[sheets/actions current-chat])
:height 256}])}]}])
(defn topbar []
(let [current-chat @(re-frame/subscribe [:current-chat/metadata])]
[topbar/topbar
{:content [toolbar-content/toolbar-content-view]
:navigation {:on-press #(re-frame/dispatch [:navigate-to :home])}
:right-accessories [{:icon :main-icons/more
:accessibility-label :chat-menu-button
:on-press
#(re-frame/dispatch [:bottom-sheet/show-sheet
{:content (fn []
[sheets/actions current-chat])
:height 256}])}]}]))
(defn add-contact-bar [public-key]
(let [added? @(re-frame/subscribe [:contacts/contact-added? public-key])]
@ -227,7 +223,7 @@
@(re-frame/subscribe [:chats/current-chat])]
[react/view {:style {:flex 1}}
[connectivity/connectivity
[topbar current-chat]
[topbar]
[react/view {:style {:flex 1}}
(when-not group-chat
[add-contact-bar chat-id])

View File

@ -31,7 +31,7 @@
(letsubs [blocked-contacts-count [:contacts/blocked-count]
contacts [:contacts/active]]
[react/view {:flex 1}
[topbar/topbar {:title :t/contacts}]
[topbar/topbar {:title (i18n/label :t/contacts)}]
[react/scroll-view {:flex 1}
[add-new-contact]
(when (pos? blocked-contacts-count)
@ -59,7 +59,7 @@
(letsubs [blocked-contacts [:contacts/blocked]]
[react/view {:flex 1
:background-color colors/white}
[topbar/topbar {:title :t/blocked-users}]
[topbar/topbar {:title (i18n/label :t/blocked-users)}]
[react/scroll-view {:style {:background-color colors/white
:padding-vertical 8}}
[list.views/flat-list

View File

@ -2,6 +2,7 @@
(:require-macros [status-im.utils.views :as views])
(:require [re-frame.core :as re-frame]
[reagent.core :as reagent]
[status-im.i18n :as i18n]
[status-im.ui.components.react :as react]
[status-im.ui.components.icons.vector-icons :as vector-icons]
[status-im.ui.components.list.views :as list]
@ -30,7 +31,7 @@
(re-frame/dispatch [:search/currency-filter-changed nil])
(reset! search-active? false))}
[react/view {:flex 1}
[topbar/topbar {:title :t/main-currency}]
[topbar/topbar {:title (i18n/label :t/main-currency)}]
[react/view {:flex 1}
[react/view {:padding-horizontal 16
:padding-vertical 10}

View File

@ -34,7 +34,7 @@
(views/defview dapps-permissions []
(views/letsubs [permissions [:dapps/permissions]]
[react/view {:flex 1 :background-color colors/white}
[topbar/topbar {:title :t/dapps-permissions}]
[topbar/topbar {:title (i18n/label :t/dapps-permissions)}]
[list/flat-list
{:data (vec (map prepare-items (vals permissions)))
:key-fn (fn [_ i] (str i))

View File

@ -80,7 +80,7 @@
{:color colors/white-persist}]])
(defn- toolbar []
[topbar/topbar {:title :t/ens-your-username}])
[topbar/topbar {:title (i18n/label :t/ens-your-username)}])
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; SEARCH SCREEN
@ -423,7 +423,7 @@
(views/defview terms []
(views/letsubs [{:keys [contract]} [:get-screen-params :ens-terms]]
[react/scroll-view {:style {:flex 1}}
[topbar/topbar {:title :t/ens-terms-registration}]
[topbar/topbar {:title (i18n/label :t/ens-terms-registration)}]
[react/view {:style {:height 136 :background-color colors/gray-lighter :justify-content :center :align-items :center}}
[react/text {:style {:text-align :center :typography :header :letter-spacing -0.275}}
(i18n/label :t/ens-terms-header)]]
@ -680,7 +680,7 @@
(views/defview main []
(views/letsubs [{:keys [names multiaccount show? registrations]} [:ens.main/screen]]
[react/keyboard-avoiding-view {:style {:flex 1}}
[topbar/topbar {:title :t/ens-usernames}]
[topbar/topbar {:title (i18n/label :t/ens-usernames)}]
(if (or (seq names) registrations)
[registered names multiaccount show? registrations]
[welcome])]))

View File

@ -1,6 +1,7 @@
(ns status-im.ui.screens.fleet-settings.views
(:require [re-frame.core :as re-frame]
[status-im.node.core :as node]
[status-im.i18n :as i18n]
[status-im.ui.components.icons.vector-icons :as vector-icons]
[status-im.ui.components.list.views :as list]
[status-im.ui.components.react :as react]
@ -35,7 +36,7 @@
(views/letsubs [custom-fleets [:fleets/custom-fleets]
current-fleet [:fleets/current-fleet]]
[react/view {:flex 1}
[topbar/topbar {:title :t/fleet-settings}]
[topbar/topbar {:title (i18n/label :t/fleet-settings)}]
[react/view styles/wrapper
[list/flat-list {:data (fleets custom-fleets)
:default-separator? false

View File

@ -50,7 +50,7 @@
:data v})))]
[react/view {:flex 1
:background-color colors/white}
[topbar/topbar {:title :t/glossary}]
[topbar/topbar {:title (i18n/label :t/glossary)}]
[list/section-list
{:contentContainerStyle {:padding-horizontal 16
:padding-bottom 16}

View File

@ -6,7 +6,6 @@
[status-im.constants :as constants]
[status-im.i18n :as i18n]
[status-im.ui.components.chat-icon.screen :as chat-icon]
[status-im.ui.components.colors :as colors]
[status-im.ui.components.contact.contact :as contact]
[status-im.multiaccounts.core :as multiaccounts]
[status-im.ui.components.keyboard-avoid-presentation
@ -16,8 +15,7 @@
[status-im.ui.components.list.views :as list]
[status-im.ui.components.react :as react]
[status-im.ui.components.search-input.view :as search]
[status-im.ui.components.toolbar :as bottom-toolbar]
[status-im.ui.components.toolbar.view :as toolbar]
[status-im.ui.components.toolbar :as toolbar]
[status-im.ui.components.topbar :as topbar]
[status-im.ui.screens.group.styles :as styles]
[quo.core :as quo]
@ -100,17 +98,11 @@
(let [save-btn-enabled? (and (spec/valid? :global/not-empty-string group-name) (pos? (count contacts)))]
[kb-presentation/keyboard-avoiding-view {:style styles/group-container}
[react/view {:flex 1}
[toolbar/toolbar {}
toolbar/default-nav-back
[react/view {:style styles/toolbar-header-container}
[react/view
[react/text (i18n/label :t/new-group-chat)]]
[react/view
[react/text {:style (styles/toolbar-sub-header)}
(i18n/label :t/group-chat-members-count
{:selected (inc (count contacts))
:max constants/max-group-chat-participants})]]]]
[topbar/topbar {:use-insets false
:title (i18n/label :t/new-group-chat)
:subtitle (i18n/label :t/group-chat-members-count
{:selected (inc (count contacts))
:max constants/max-group-chat-participants})}]
[react/view {:style {:padding-top 16
:flex 1}}
[react/view {:style {:padding-horizontal 16}}
@ -130,7 +122,7 @@
:bounces false
:keyboard-should-persist-taps :always
:enable-empty-sections true}]]]
[bottom-toolbar/toolbar
[toolbar/toolbar
{:show-border? true
:left
[quo/button {:type :secondary
@ -165,23 +157,19 @@
(views/letsubs [contacts [:contacts/active]
selected-contacts-count [:selected-contacts-count]]
[kb-presentation/keyboard-avoiding-view {:style styles/group-container}
[toolbar/toolbar {:border-bottom-color colors/white}
toolbar/default-nav-back
[react/view {:style styles/toolbar-header-container}
[react/view
[react/text (i18n/label :t/new-group-chat)]]
[react/view
[react/text {:style (styles/toolbar-sub-header)}
(i18n/label :t/group-chat-members-count
{:selected (inc selected-contacts-count)
:max constants/max-group-chat-participants})]]]]
[topbar/topbar {:use-insets false
:border-bottom false
:title (i18n/label :t/new-group-chat)
:subtitle (i18n/label :t/group-chat-members-count
{:selected (inc selected-contacts-count)
:max constants/max-group-chat-participants})}]
[searchable-contact-list
{:contacts contacts
:no-contacts-label (i18n/label :t/group-chat-no-contacts)
:toggle-fn group-toggle-contact
:allow-new-users? (< selected-contacts-count
(dec constants/max-group-chat-participants))}]
[bottom-toolbar/toolbar
[toolbar/toolbar
{:show-border? true
:right
[quo/button {:type :secondary
@ -198,16 +186,12 @@
selected-contacts-count [:selected-participants-count]]
(let [current-participants-count (count (:contacts current-chat))]
[kb-presentation/keyboard-avoiding-view {:style styles/group-container}
[toolbar/toolbar {:border-bottom-color colors/white}
toolbar/default-nav-back
[react/view {:style styles/toolbar-header-container}
[react/view
[react/text (i18n/label :t/add-members)]]
[react/view
[react/text {:style (styles/toolbar-sub-header)}
(i18n/label :t/group-chat-members-count
{:selected (+ current-participants-count selected-contacts-count)
:max constants/max-group-chat-participants})]]]]
[topbar/topbar {:use-insets false
:border-bottom false
:title (i18n/label :t/add-members)
:subtitle (i18n/label :t/group-chat-members-count
{:selected (+ current-participants-count selected-contacts-count)
:max constants/max-group-chat-participants})}]
[searchable-contact-list
{:contacts contacts
:no-contacts-label (i18n/label :t/group-chat-all-contacts-invited)
@ -215,7 +199,7 @@
:allow-new-users? (< (+ current-participants-count
selected-contacts-count)
constants/max-group-chat-participants)}]
[bottom-toolbar/toolbar
[toolbar/toolbar
{:show-border? true
:center
[quo/button {:type :secondary
@ -229,7 +213,7 @@
new-group-chat-name (reagent/atom nil)]
[kb-presentation/keyboard-avoiding-view {:style styles/group-container}
[topbar/topbar
{:title :t/edit-group
{:title (i18n/label :t/edit-group)
:modal? true}]
[react/scroll-view {:style {:padding 16
:flex 1}}
@ -242,7 +226,7 @@
:accessibility-label :new-chat-name
:return-key-type :go}]]
[react/view {:style {:flex 1}}]
[bottom-toolbar/toolbar
[toolbar/toolbar
{:show-border? true
:center
[quo/button {:type :secondary

View File

@ -39,7 +39,7 @@
(defn help-center []
[react/view {:flex 1 :background-color colors/white}
[topbar/topbar {:title :t/need-help}]
[topbar/topbar {:title (i18n/label :t/need-help)}]
[list/flat-list
{:data data
:key-fn (fn [_ i] (str i))

View File

@ -172,7 +172,7 @@
(defn home []
[react/keyboard-avoiding-view {:style styles/home-container}
[connectivity/connectivity
[topbar/topbar {:title :t/chat :navigation :none
:show-border? true}]
[topbar/topbar {:title (i18n/label :t/chat)
:navigation :none}]
[chats-list]]
[plus-button]])

View File

@ -33,7 +33,8 @@
(reset! show-error true))))]
[rn/keyboard-avoiding-view {:flex 1}
[topbar/topbar
{:navigation
{:border-bottom false
:navigation
{:icon :main-icons/back
:accessibility-label :back-button
:handler #(re-frame/dispatch [:intro-wizard/navigate-back])}}]

View File

@ -317,10 +317,9 @@
(letsubs [wizard-state [:intro-wizard/generate-key]]
[react/view {:style {:flex 1}}
[topbar/topbar
{:navigation
{:icon :main-icons/arrow-left
:accessibility-label :back-button
:handler #(re-frame/dispatch [:intro-wizard/navigate-back])}}]
{:border-bottom false
:navigation
{:on-press #(re-frame/dispatch [:intro-wizard/navigate-back])}}]
[react/view {:style {:flex 1
:justify-content :space-between}}
[top-bar {:step :generate-key}]
@ -333,9 +332,10 @@
(letsubs [wizard-state [:intro-wizard/choose-key]]
[react/view {:style {:flex 1}}
[topbar/topbar
{:navigation
{:label :t/cancel
:handler #(re-frame/dispatch [:intro-wizard/navigate-back])}}]
{:border-bottom false
:navigation
{:label (i18n/label :t/cancel)
:on-press #(re-frame/dispatch [:intro-wizard/navigate-back])}}]
[react/view {:style {:flex 1
:justify-content :space-between}}
[top-bar {:step :choose-key}]
@ -349,12 +349,9 @@
[topbar/topbar
{:navigation
(if (:recovering? wizard-state)
{:label :t/cancel
:accessibility-label :back-button
:handler #(re-frame/dispatch [:intro-wizard/navigate-back])}
{:icon :main-icons/arrow-left
:accessibility-label :back-button
:handler #(re-frame/dispatch [:intro-wizard/navigate-back])})}]
{:label (i18n/label :t/cancel)
:on-press #(re-frame/dispatch [:intro-wizard/navigate-back])}
{:on-press #(re-frame/dispatch [:intro-wizard/navigate-back])})}]
[react/view {:style {:flex 1
:justify-content :space-between}}
[top-bar {:step :select-key-storage}]
@ -366,10 +363,9 @@
(letsubs [wizard-state [:intro-wizard/enter-phrase]]
[react/keyboard-avoiding-view {:style {:flex 1}}
[topbar/topbar
{:navigation
{:icon :main-icons/arrow-left
:accessibility-label :back-button
:handler #(re-frame/dispatch [:intro-wizard/navigate-back])}}]
{:border-bottom false
:navigation
{:on-press #(re-frame/dispatch [:intro-wizard/navigate-back])}}]
[react/view {:style {:flex 1
:justify-content :space-between}}
[top-bar {:step :enter-phrase}]
@ -383,10 +379,9 @@
existing-account? [:intro-wizard/recover-existing-account?]]
[react/view {:style {:flex 1}}
[topbar/topbar
{:navigation
{:icon :main-icons/arrow-left
:accessibility-label :back-button
:handler #(re-frame/dispatch [:intro-wizard/navigate-back])}}]
{:border-bottom false
:navigation
{:on-press #(re-frame/dispatch [:intro-wizard/navigate-back])}}]
[react/view {:style {:flex 1
:justify-content :space-between}}
[top-bar {:step :recovery-success}]

View File

@ -1,7 +1,6 @@
(ns status-im.ui.screens.keycard.onboarding.views
(:require [re-frame.core :as re-frame]
[status-im.keycard.onboarding :as keycard.onboarding]
[status-im.ui.components.toolbar.view :as toolbar]
[status-im.ui.components.toolbar :as bottom-toolbar]
[status-im.ui.components.colors :as colors]
[status-im.ui.components.react :as react]
@ -93,16 +92,10 @@
steps [:keycard-flow-steps]
puk-code [:keycard-puk-code]]
[react/view styles/container
[toolbar/toolbar
{:transparent? true}
[toolbar/nav-text
{:handler #(re-frame/dispatch [::keycard.onboarding/cancel-pressed])
:style {:padding-left 21}}
(i18n/label :t/cancel)]
[react/text {:style {:color colors/gray}
:accessibility-label :cancel-keycard-setup}
(i18n/label :t/step-i-of-n {:step "2"
:number steps})]]
[topbar/topbar {:navigation {:on-press #(re-frame/dispatch [::keycard.onboarding/cancel-pressed])
:label (i18n/label :t/cancel)}
:title (i18n/label :t/step-i-of-n {:step "2"
:number steps})}]
[react/scroll-view {:content-container-style {:flex-grow 1
:justify-content :space-between}}
[react/view {:flex 1
@ -188,16 +181,11 @@
small-screen? [:dimensions/small-screen?]
setup-step [:keycard-setup-step]]
[react/view styles/container
[toolbar/toolbar
{:transparent? true}
[toolbar/nav-text
{:handler #(re-frame/dispatch [::keycard.onboarding/cancel-pressed])
:style {:padding-left 21}}
(i18n/label :t/cancel)]
(when-not (= setup-step :loading-keys)
[react/text {:style {:color colors/gray}}
(i18n/label :t/step-i-of-n {:number steps
:step 1})])]
[topbar/topbar {:navigation {:on-press #(re-frame/dispatch [::keycard.onboarding/cancel-pressed])
:label (i18n/label :t/cancel)}
:title (when-not (= setup-step :loading-keys)
(i18n/label :t/step-i-of-n {:number steps
:step 1}))}]
[react/view {:flex 1
:flex-direction :column
:justify-content :space-between
@ -234,15 +222,11 @@
(defview recovery-phrase []
(letsubs [mnemonic [:keycard-mnemonic]]
[react/view styles/container
[toolbar/toolbar
{:transparent? true}
[toolbar/nav-text
{:handler #(re-frame/dispatch [::keycard.onboarding/cancel-pressed])
:style {:padding-left 21}}
(i18n/label :t/cancel)]
[react/text {:style {:color colors/gray}}
(i18n/label :t/step-i-of-n {:step "3"
:number "3"})]]
[topbar/topbar
{:navigation {:on-press #(re-frame/dispatch [::keycard.onboarding/cancel-pressed])
:label (i18n/label :t/cancel)}
:title (i18n/label :t/step-i-of-n {:step "3"
:number "3"})}]
[react/scroll-view {:content-container-style {:flex-grow 1
:justify-content :space-between}}
[react/view {:flex-direction :column
@ -299,15 +283,12 @@
error [:keycard-recovery-phrase-confirm-error]]
(let [{:keys [idx]} word]
[react/view styles/container
[toolbar/toolbar
{:transparent? true}
[toolbar/nav-text
{:handler #(re-frame/dispatch [::keycard.onboarding/cancel-pressed])
:accessibility-label :cancel-keycard-setup
:style {:padding-left 21}}
(i18n/label :t/cancel)]
[react/text {:style {:color colors/gray}}
(i18n/label :t/step-i-of-n {:step 3 :number 3})]]
[topbar/topbar
{:navigation {:on-press #(re-frame/dispatch [::keycard.onboarding/cancel-pressed])
:accessibility-label :cancel-keycard-setup
:label (i18n/label :t/cancel)}
:title (i18n/label :t/step-i-of-n {:step "3"
:number "3"})}]
[react/view {:flex 1
:flex-direction :column
:justify-content :space-between

View File

@ -7,7 +7,6 @@
[status-im.ui.components.icons.vector-icons :as vector-icons]
[status-im.ui.components.colors :as colors]
[status-im.ui.components.toolbar :as bottom-toolbar]
[status-im.ui.components.toolbar.view :as toolbar]
[status-im.ui.components.tooltip.views :as tooltip]
[status-im.ui.components.topbar :as topbar]
[status-im.ui.screens.keycard.pin.views :as pin.views]
@ -74,16 +73,12 @@
small-screen? [:dimensions/small-screen?]
retry-counter [:keycard/retry-counter]]
[react/view styles/container
[toolbar/toolbar
{:transparent? true}
[toolbar/nav-text
{:handler #(re-frame/dispatch [::keycard.recovery/cancel-pressed])
:style {:padding-left 21}}
(i18n/label :t/cancel)]
(when-not (#{:frozen-card :blocked-card} status)
[react/text {:style {:color colors/gray}}
(i18n/label :t/step-i-of-n {:number 2
:step 2})])]
[topbar/topbar
{:navigation {:on-press #(re-frame/dispatch [::keycard.recovery/cancel-pressed])
:label (i18n/label :t/cancel)}
:title (when-not (#{:frozen-card :blocked-card} status)
(i18n/label :t/step-i-of-n {:number 2
:step 2}))}]
(case status
:frozen-card
[keycard.views/frozen-card]
@ -114,12 +109,8 @@
error [:keycard-setup-error]
{:keys [free-pairing-slots]} [:keycard-application-info]]
[react/view styles/container
[toolbar/toolbar
{:transparent? true}
toolbar/default-nav-back
[react/text {:style {:color colors/gray}}
(i18n/label :t/step-i-of-n {:number 2
:step 1})]]
[topbar/topbar {:title (i18n/label :t/step-i-of-n {:number 2
:step 1})}]
[react/view {:flex 1
:flex-direction :column
:justify-content :space-between

View File

@ -30,7 +30,7 @@
(defview reset-card []
(letsubs [disabled? [:keycard-reset-card-disabled?]]
[react/view {:flex 1}
[topbar/topbar {:title :t/reset-card}]
[topbar/topbar {:title (i18n/label :t/reset-card)}]
[react/view {:flex 1
:background-color colors/white}
[react/view {:margin-top 71
@ -67,7 +67,7 @@
puk-retry-counter [:keycard/puk-retry-counter]
pairing [:keycard-multiaccount-pairing]]
[react/view {:flex 1}
[topbar/topbar {:title :t/status-keycard}]
[topbar/topbar {:title (i18n/label :t/status-keycard)}]
[react/scroll-view {:flex 1}
[react/view {:margin-top 47
:align-items :center}

View File

@ -246,16 +246,6 @@
:on-press #(.openURL ^js react/linking "https://status.im/faq/#keycard")}
(i18n/label :t/learn-more)]]]])
(defn- step-view [step]
[react/view
{:style {:flex 1
:justify-content :center
:align-items :center}}
[react/text {:style {:typography :title-bold :text-align :center}}
(i18n/label :t/keycard-reset-passcode)]
[react/text {:style {:color colors/gray}}
(i18n/label :t/keycard-enter-new-passcode {:step step})]])
(defview login-pin [{:keys [back-button-handler
hide-login-actions?
default-enter-step]
@ -275,30 +265,22 @@
enter-step (or enter-step default-enter-step)]
[react/view styles/container
[topbar/topbar
{:accessories [(when-not hide-login-actions?
{:icon :main-icons/more
:handler #(re-frame/dispatch [:keycard.login.pin.ui/more-icon-pressed])})]
:content (cond
(= :reset enter-step)
[step-view 1]
(merge
{:right-accessories [(when-not hide-login-actions?
{:icon :main-icons/more
:on-press #(re-frame/dispatch [:keycard.login.pin.ui/more-icon-pressed])})]
:title (cond
(#{:reset :reset-confirmation} enter-step)
(i18n/label :t/keycard-reset-passcode)
(= :reset-confirmation enter-step)
[step-view 2]
(and (= :puk enter-step)
(not= :blocked-card status))
[react/view
{:style {:flex 1
:justify-content :center
:align-items :center}}
[react/text {:style {:color colors/gray}}
(i18n/label :t/enter-puk-code)]])
:navigation
{:icon :main-icons/arrow-left
:accessibility-label :back-button
:handler #(re-frame/dispatch
[(or back-button-handler
:keycard.login.pin.ui/cancel-pressed)])}}]
(and (= :puk enter-step)
(not= :blocked-card status))
(i18n/label :t/enter-puk-code))
:navigation {:on-press #(re-frame/dispatch
[(or back-button-handler
:keycard.login.pin.ui/cancel-pressed)])}}
(when (#{:reset :reset-confirmation} enter-step)
{:subtitle (i18n/label :t/keycard-enter-new-passcode {:step (if (= :reset enter-step) 1 2)})}))]
[react/view {:flex 1
:flex-direction :column
:justify-content :space-between

View File

@ -1,8 +0,0 @@
(ns status-im.ui.screens.language-settings.views
(:require [status-im.ui.components.colors :as colors]
[status-im.ui.components.react :as react]
[status-im.ui.components.topbar :as topbar]))
(defn language-settings []
[react/view {:flex 1 :background-color colors/white}
[topbar/topbar {:title :t/language}]])

View File

@ -1,5 +1,6 @@
(ns status-im.ui.screens.log-level-settings.views
(:require [re-frame.core :as re-frame]
[status-im.i18n :as i18n]
[status-im.ui.components.icons.vector-icons :as vector-icons]
[status-im.ui.components.list.views :as list]
[status-im.ui.components.react :as react]
@ -44,7 +45,7 @@
(views/defview log-level-settings []
(views/letsubs [current-log-level [:log-level/current-log-level]]
[react/view {:flex 1}
[topbar/topbar {:title :t/log-level-settings}]
[topbar/topbar {:title (i18n/label :t/log-level-settings)}]
[react/view styles/wrapper
[list/flat-list {:data log-levels
:default-separator? false

View File

@ -24,7 +24,7 @@
remember-syncing-choice?]}
[:multiaccount]]
[react/view {:style styles/container}
[topbar/topbar {:title :t/mobile-network-settings}]
[topbar/topbar {:title (i18n/label :t/mobile-network-settings)}]
[react/view {:style styles/switch-container}
[profile.components/settings-switch-item
{:label-kw :t/mobile-network-use-mobile

View File

@ -44,7 +44,7 @@
view-id [:view-id]
supported-biometric-auth [:supported-biometric-auth]]
[react/keyboard-avoiding-view {:style ast/multiaccounts-view}
[topbar/topbar {}]
[topbar/topbar {:border-bottom false}]
[react/scroll-view {:keyboardShouldPersistTaps :always
:style styles/login-view}
[react/view styles/login-badge-container

View File

@ -37,12 +37,12 @@
(defview multiaccounts []
(letsubs [multiaccounts [:multiaccounts/multiaccounts]]
[react/view styles/multiaccounts-view
[topbar/topbar {:show-border? true
:navigation :none
:title (i18n/label :t/your-keys)
:accessories [{:icon :more
:accessibility-label :your-keys-more-icon
:handler #(re-frame/dispatch [:bottom-sheet/show-sheet {:content sheets/actions-sheet}])}]}]
[topbar/topbar {:navigation :none
:title (i18n/label :t/your-keys)
:right-accessories [{:icon :more
:accessibility-label :your-keys-more-icon
:on-press #(re-frame/dispatch [:bottom-sheet/show-sheet
{:content sheets/actions-sheet}])}]}]
[react/view styles/multiaccounts-container
[list/flat-list {:data (vals multiaccounts)
:contentContainerStyle styles/multiaccounts-list-container

View File

@ -1,6 +1,7 @@
(ns status-im.ui.screens.network-info.views
(:require [status-im.ui.components.topbar :as topbar]
[status-im.ui.components.react :as react]
[status-im.i18n :as i18n]
[re-frame.core :as re-frame]
[status-im.ui.components.styles :as components.styles]
[reagent.core :as reagent]
@ -81,5 +82,5 @@
(defn network-info []
[react/view components.styles/flex
[topbar/topbar
{:title :t/network-info}]
{:title (i18n/label :t/network-info)}]
[check-lag]])

View File

@ -38,7 +38,7 @@
(empty? validation-errors))
invalid-url? (contains? validation-errors :url)]
[react/keyboard-avoiding-view {:style {:flex 1}}
[topbar/topbar {:title (if id :t/mailserver-details :t/add-mailserver)}]
[topbar/topbar {:title (i18n/label (if id :t/mailserver-details :t/add-mailserver))}]
[react/scroll-view {:keyboard-should-persist-taps :handled}
[react/view styles/edit-mailserver-view
[react/view {:padding-vertical 8}

View File

@ -48,9 +48,10 @@
mailservers [:mailserver/fleet-mailservers]]
[react/view {:flex 1}
[topbar/topbar
{:title :t/offline-messaging-settings
:accessories [{:icon :main-icons/add
:handler #(re-frame/dispatch [:mailserver.ui/add-pressed])}]}]
{:title (i18n/label :t/offline-messaging-settings)
:right-accessories
[{:icon :main-icons/add
:on-press #(re-frame/dispatch [:mailserver.ui/add-pressed])}]}]
[react/view styles/wrapper
[pinned-state preferred-mailserver-id]
[list/flat-list {:data (vals mailservers)

View File

@ -163,7 +163,7 @@
(views/defview installations []
(views/letsubs [installations [:pairing/installations]]
[react/view {:flex 1}
[topbar/topbar {:title :t/devices}]
[topbar/topbar {:title (i18n/label :t/devices)}]
[react/scroll-view
(if (string/blank? (-> installations first :name))
[edit-installation-name]

View File

@ -19,7 +19,7 @@
auth-method [:auth-method]
keycard? [:keycard-multiaccount?]]
[react/view {:flex 1 :background-color colors/white}
[topbar/topbar {:title :t/privacy-and-security}]
[topbar/topbar {:title (i18n/label :t/privacy-and-security)}]
[react/scroll-view {:padding-vertical 8}
[quo/list-header (i18n/label :t/security)]
[quo/list-item {:size :small

View File

@ -1,8 +1,7 @@
(ns status-im.ui.screens.profile.seed.views
(:require-macros [status-im.utils.views :refer [defview letsubs]])
(:require [status-im.ui.components.react :as react]
[status-im.ui.components.toolbar.view :as not.toolbar]
[status-im.ui.components.toolbar.actions :as actions]
[status-im.ui.components.topbar :as topbar]
[status-im.react-native.resources :as resources]
[re-frame.core :as re-frame]
[reagent.core :as reagent]
@ -141,18 +140,14 @@
(letsubs [current-multiaccount [:multiaccount]
{:keys [step first-word second-word error word]} [:my-profile/recovery]]
[react/keyboard-avoiding-view {:style {:flex 1}}
[not.toolbar/toolbar
nil
(when-not (= :finish step)
(not.toolbar/nav-button (actions/back #(step-back step))))
[react/view
[react/text {:style styles/backup-seed}
(i18n/label :t/backup-recovery-phrase)]
[react/text {:style styles/step-n}
(i18n/label :t/step-i-of-n {:step (steps-numbers step) :number 3})]]]
[topbar/topbar {:title (i18n/label :t/backup-recovery-phrase)
:subtitle (i18n/label :t/step-i-of-n {:step (steps-numbers step) :number 3})
:navigation (if (= :finish step)
:none
{:on-press #(step-back step)})}]
(case step
:intro [intro]
:12-words [twelve-words current-multiaccount]
:first-word [enter-word step first-word error word]
:intro [intro]
:12-words [twelve-words current-multiaccount]
:first-word [enter-word step first-word error word]
:second-word [enter-word step second-word error word]
:finish [finish])]))
:finish [finish])]))

View File

@ -6,8 +6,7 @@
[quo.core :as quo]
[status-im.ui.components.icons.vector-icons :as icons]
[status-im.ui.components.react :as react]
[status-im.ui.components.toolbar.actions :as actions]
[status-im.ui.components.toolbar.view :as not.toolbar]
[status-im.ui.components.topbar :as topbar]
[status-im.ui.components.toolbar :as toolbar]
[status-im.ui.screens.profile.tribute-to-talk.styles :as styles])
(:require-macros [status-im.utils.views :refer [defview letsubs]]))
@ -278,15 +277,12 @@
(defn learn-more [owner?]
[react/view {:flex 1}
(when-not owner?
[not.toolbar/toolbar nil not.toolbar/default-nav-close
[react/view
[react/text {:style styles/tribute-to-talk}
(i18n/label :t/tribute-to-talk)]
[react/text {:style styles/step-n}
(i18n/label :t/learn-more)]]])
[topbar/topbar {:modal? true
:title (i18n/label :t/tribute-to-talk)
:subtitle (i18n/label :t/learn-more)}])
[react/scroll-view {:content-container-style styles/learn-more-container}
[react/image {:source (resources/get-image :tribute-to-talk)
:style styles/learn-more-image}]
:style styles/learn-more-image}]
[react/text {:style styles/learn-more-title-text}
(i18n/label :t/tribute-to-talk)]
[react/view {:style styles/learn-more-text-container-1}
@ -294,13 +290,13 @@
(i18n/label (if owner? :t/tribute-to-talk-learn-more-1
:t/tribute-to-talk-paywall-learn-more-1))]]
[separator]
[pay-to-chat-message {:snt-amount 1000
:token " SNT"
[pay-to-chat-message {:snt-amount 1000
:token " SNT"
:fiat-currency "USD"
:fiat-amount "5"
:style (assoc styles/learn-more-section
:align-items :flex-start
:margin-top 24)}]
:fiat-amount "5"
:style (assoc styles/learn-more-section
:align-items :flex-start
:margin-top 24)}]
[react/view {:style styles/learn-more-text-container-2}
[react/text {:style styles/learn-more-text}
(i18n/label (if owner? :t/tribute-to-talk-learn-more-2
@ -321,34 +317,34 @@
:t/tribute-to-talk-paywall-learn-more-3))]]]])
(defview tribute-to-talk []
(letsubs [{:keys [step snt-amount editing?
(letsubs [{:keys [step snt-amount
fiat-value disable-button? state]}
[:tribute-to-talk/settings-ui]]
[react/keyboard-avoiding-view {:style styles/container}
[react/view {:style {:flex 1}}
[not.toolbar/toolbar
nil
(when-not (= :finish step)
(not.toolbar/nav-button
(actions/back #(re-frame/dispatch
[:tribute-to-talk.ui/step-back-pressed]))))
[react/view
[react/text {:style styles/tribute-to-talk}
(i18n/label :t/tribute-to-talk)]
(when-not (#{:edit :learn-more} step)
[react/text {:style styles/step-n}
(if (= step :finish)
(i18n/label (case state
:completed :t/completed
:pending :t/pending
:signing :t/signing
:transaction-failed :t/transaction-failed
:disabled :t/disabled))
(i18n/label :t/step-i-of-n {:step ((steps-numbers editing?) step)
:number (if editing? 2 3)}))])
(when (= step :learn-more)
[react/text {:style styles/step-n}
(i18n/label :t/learn-more)])]]
;; [toolbar/toolbar
;; nil
;; (when-not (= :finish step)
;; (toolbar/nav-button
;; (actions/back #(re-frame/dispatch
;; [:tribute-to-talk.ui/step-back-pressed]))))
;; [react/view
;; [react/text {:style styles/tribute-to-talk}
;; (i18n/label :t/tribute-to-talk)]
;; (when-not (#{:edit :learn-more} step)
;; [react/text {:style styles/step-n}
;; (if (= step :finish)
;; (i18n/label (case state
;; :completed :t/completed
;; :pending :t/pending
;; :signing :t/signing
;; :transaction-failed :t/transaction-failed
;; :disabled :t/disabled))
;; (i18n/label :t/step-i-of-n {:step ((steps-numbers editing?) step)
;; :number (if editing? 2 3)}))])
;; (when (= step :learn-more)
;; [react/text {:style styles/step-n}
;; (i18n/label :t/learn-more)])]]
(case step
:intro [intro]

View File

@ -3,50 +3,46 @@
(:require [re-frame.core :as re-frame]
[clojure.string :as string]
[status-im.i18n :as i18n]
[status-im.ui.components.topbar :as topbar]
[status-im.ui.components.camera :as camera]
[status-im.ui.components.react :as react]
[status-im.ui.components.toolbar.view :as topbar]
[status-im.ui.screens.qr-scanner.styles :as styles]
[status-im.ui.components.colors :as colors]
[status-im.utils.config :as config]
[quo.core :as quo]
[quo.components.safe-area :as safe-area]))
[quo.core :as quo]))
(defn- topbar [_ {:keys [title] :as opts}]
[topbar/toolbar
{:transparent? true}
[topbar/nav-text
{:style {:color colors/white-persist :margin-left 16}
:handler #(re-frame/dispatch [:qr-scanner.callback/scan-qr-code-cancel opts])}
(i18n/label :t/cancel)]
[topbar/content-title {:color colors/white-persist}
(or title (i18n/label :t/scan-qr))]
#_[topbar/actions [{:icon (if (= :on camera-flashlight)
:main-icons/flash-active
:main-icons/flash-inactive)
:icon-opts {:color colors/white}
:handler #(re-frame/dispatch [:wallet/toggle-flashlight])}]]])
[topbar/topbar
{:background colors/black-persist
:use-insets true
:border-bottom false
:navigation :none
:left-component [quo/button {:type :secondary
:on-press #(re-frame/dispatch [:qr-scanner.callback/scan-qr-code-cancel opts])}
[quo/text {:style {:color colors/white-persist}}
(i18n/label :t/cancel)]]
:title-component [quo/text {:style {:color colors/white-persist}
:weight :bold
:number-of-lines 1
:align :center
:size :large}
(or title (i18n/label :t/scan-qr))]}])
(defn qr-test-view [opts]
(let [text-value (atom "")]
[safe-area/consumer
(fn [insets]
[react/view {:flex 1 :background-color colors/black-persist
:padding-top (:top insets) :padding-bottom (:bottom insets)}
[topbar nil opts]
[react/view {:flex 1
:align-items :center
:justify-content :center}
[react/text-input {:multiline true
:style {:color colors/white-persist}
:on-change-text #(reset! text-value %)}]
[react/view {:flex-direction :row}
[quo/button
{:on-press #(re-frame/dispatch [:qr-scanner.callback/scan-qr-code-cancel opts])}
"Cancel"]
[quo/button
{:on-press #(re-frame/dispatch [:qr-scanner.callback/scan-qr-code-success opts (when-let [text @text-value] (string/trim text))])}
"Ok"]]]])]))
[react/view {:flex 1
:align-items :center
:justify-content :center}
[react/text-input {:multiline true
:style {:color colors/white-persist}
:on-change-text #(reset! text-value %)}]
[react/view {:flex-direction :row}
[quo/button
{:on-press #(re-frame/dispatch [:qr-scanner.callback/scan-qr-code-cancel opts])}
"Cancel"]
[quo/button
{:on-press #(re-frame/dispatch [:qr-scanner.callback/scan-qr-code-success opts (when-let [text @text-value] (string/trim text))])}
"Ok"]]]))
(defn corner [border1 border2 corner]
[react/view (assoc {:border-color colors/white-persist :width 60 :height 60} border1 5 border2 5 corner 32)])
@ -70,21 +66,20 @@
camera-flashlight [:wallet.send/camera-flashlight]
opts [:get-screen-params]
camera-ref (atom nil)]
(if config/qr-test-menu-enabled?
[qr-test-view opts]
[safe-area/consumer
(fn [insets]
[react/view {:flex 1 :background-color colors/black-persist
:padding-top (:top insets) :padding-bottom (:bottom insets)}
[topbar camera-flashlight opts]
[react/with-activity-indicator
{}
[camera/camera
{:ref #(reset! camera-ref %)
:style {:flex 1}
:camera-options {:zoomMode :off}
:scan-barcode true
:on-read-code #(when-not @read-once?
(reset! read-once? true)
(on-barcode-read opts %))}]]
[viewfinder (int (* 2 (/ (min height width) 3)))]])])))
[react/view {:flex 1
:background-color colors/black-persist}
[topbar camera-flashlight opts]
(if config/qr-test-menu-enabled?
[qr-test-view opts]
[react/view {:flex 1}
[react/with-activity-indicator
{}
[camera/camera
{:ref #(reset! camera-ref %)
:style {:flex 1}
:camera-options {:zoomMode :off}
:scan-barcode true
:on-read-code #(when-not @read-once?
(reset! read-once? true)
(on-barcode-read opts %))}]]
[viewfinder (int (* 2 (/ (min height width) 3)))]])]))

View File

@ -10,6 +10,7 @@
[stack {:initial-route-name :open-dapp
:header-mode :none}
[{:name :open-dapp
:insets {:top true}
:style {:padding-bottom tabbar.styles/tabs-diff}
:component open-dapp/open-dapp}
{:name :browser

View File

@ -16,7 +16,6 @@
offline-messaging-settings]
[status-im.ui.screens.dapps-permissions.views :as dapps-permissions]
[status-im.ui.screens.privacy-and-security-settings.views :as privacy-and-security]
[status-im.ui.screens.language-settings.views :as language-settings]
[status-im.ui.screens.sync-settings.views :as sync-settings]
[status-im.ui.screens.advanced-settings.views :as advanced-settings]
[status-im.ui.screens.help-center.views :as help-center]
@ -84,8 +83,6 @@
:component privacy-and-security/privacy-and-security}
{:name :appearance
:component appearance/appearance}
{:name :language-settings
:component language-settings/language-settings}
{:name :sync-settings
:component sync-settings/sync-settings}
{:name :advanced-settings

View File

@ -60,7 +60,7 @@
(letsubs [packs [:stickers/all-packs]]
[react/view styles/screen
[react/keyboard-avoiding-view components.styles/flex
[topbar/topbar {:title :t/sticker-market}]
[topbar/topbar {:title (i18n/label :t/sticker-market)}]
(if (seq packs)
[react/scroll-view {:keyboard-should-persist-taps :handled :style {:padding 16}}
[react/view

View File

@ -11,7 +11,7 @@
(views/letsubs [{:keys [syncing-on-mobile-network?]} [:multiaccount]
mailserver-id [:mailserver/current-id]]
[react/view {:style {:flex 1 :background-color colors/white}}
[topbar/topbar {:title :t/sync-settings}]
[topbar/topbar {:title (i18n/label :t/sync-settings)}]
[react/scroll-view
[quo/list-header (i18n/label :t/message-syncing)]
[quo/list-item {:size :small

View File

@ -23,11 +23,11 @@
(defn toolbar-view [title]
[topbar/topbar
{:title title
:accessories
[{:icon :main-icons/more
:handler #(re-frame/dispatch [:bottom-sheet/show-sheet
{:content sheets/account-settings
:content-height 60}])}]}])
:right-accessories
[{:icon :main-icons/more
:on-press #(re-frame/dispatch [:bottom-sheet/show-sheet
{:content sheets/account-settings
:content-height 60}])}]}])
(defn button [label icon color handler]
[react/touchable-highlight {:on-press handler :style {:flex 1}}

View File

@ -44,15 +44,15 @@
keycard? [:keycard-multiaccount?]]
[react/keyboard-avoiding-view {:flex 1}
[topbar/topbar
(cond-> {:title :t/account-settings}
(cond-> {:title (i18n/label :t/account-settings)}
(and @new-account (not= "" (:name @new-account)))
(assoc :accessories [{:label :t/apply
:handler
#(do
(re-frame/dispatch [:wallet.accounts/save-account
account
@new-account])
(reset! new-account nil))}]))]
(assoc :right-accessories [{:label (i18n/label :t/apply)
:on-press
#(do
(re-frame/dispatch [:wallet.accounts/save-account
account
@new-account])
(reset! new-account nil))}]))]
[react/scroll-view {:keyboard-should-persist-taps :handled
:style {:flex 1}}
[react/view {:padding-bottom 28 :padding-top 10}

View File

@ -26,11 +26,12 @@
:key :t/add-private-key-account
"")]
[topbar/topbar
(merge {:title title}
(merge {:title (i18n/label title)}
(when (= type :watch)
{:accessories [{:icon :qr
:handler #(re-frame/dispatch [:wallet.add-new/qr-scanner
{:handler :wallet.add-new/qr-scanner-result}])}]}))]))
{:right-accessories
[{:icon :qr
:handler #(re-frame/dispatch [:wallet.add-new/qr-scanner
{:handler :wallet.add-new/qr-scanner-result}])}]}))]))
(defn common-settings [account]
[react/view {:margin-horizontal 16}
@ -120,9 +121,9 @@
[react/keyboard-avoiding-view {:style {:flex 1}}
[topbar/topbar
{:navigation :none
:accessories
:right-accessories
[{:label :t/cancel
:handler #(re-frame/dispatch [:keycard/new-account-pin-sheet-hide])}]}]
:on-press #(re-frame/dispatch [:keycard/new-account-pin-sheet-hide])}]}]
[pin.views/pin-view
{:pin pin
:status status

View File

@ -4,7 +4,7 @@
[reagent.core :as reagent]
[status-im.i18n :as i18n]
[status-im.ui.components.react :as react]
[status-im.ui.components.toolbar.view :as topbar]
[status-im.ui.components.topbar :as topbar]
[status-im.ui.screens.wallet.components.styles :as styles]
[quo.core :as quo]
[status-im.ui.components.colors :as colors]
@ -15,20 +15,14 @@
[react/view (styles/separator)])
(defn- recipient-topbar [content]
[topbar/toolbar {:transparent? true}
[topbar/nav-text
{:style {:margin-left 16}
:handler #(do
(re-frame/dispatch [:set-in [:wallet/prepare-transaction :modal-opened?] false])
(re-frame/dispatch [:navigate-back]))}
(i18n/label :t/cancel)]
[topbar/content-title {}
(i18n/label :t/recipient)]
[topbar/text-action
{:disabled? (string/blank? content)
:style {:margin-right 16}
:handler #(debounce/dispatch-and-chill [:wallet.send/set-recipient content] 3000)}
(i18n/label :t/done)]])
[topbar/topbar {:navigation {:label (i18n/label :t/cancel)
:on-press #(do
(re-frame/dispatch [:set-in [:wallet/prepare-transaction :modal-opened?] false])
(re-frame/dispatch [:navigate-back]))}
:title (i18n/label :t/recipient)
:right-accessories [{:on-press #(debounce/dispatch-and-chill [:wallet.send/set-recipient content] 3000)
:label (i18n/label :t/done)
:disabled (string/blank? content)}]}])
(views/defview contact-code []
(views/letsubs [content (reagent/atom nil)]

View File

@ -23,7 +23,7 @@
(letsubs [{:keys [contract name symbol decimals in-progress? error error-name error-symbol]}
[:wallet/custom-token-screen]]
[react/keyboard-avoiding-view {:flex 1 :background-color colors/white}
[topbar/topbar {:title :t/add-custom-token}]
[topbar/topbar {:title (i18n/label :t/add-custom-token)}]
[react/scroll-view {:keyboard-should-persist-taps :handled
:style {:flex 1
:padding-horizontal 16}}

View File

@ -16,11 +16,9 @@
(defn toolbar []
[topbar/topbar
{:title :t/wallet-assets
{:title (i18n/label :t/wallet-assets)
:navigation
{:icon :main-icons/arrow-left
:accessibility-label :back-button
:handler #(re-frame/dispatch [:wallet.settings.ui/navigate-back-pressed])}}])
{:on-press #(re-frame/dispatch [:wallet.settings.ui/navigate-back-pressed])}}])
(defn hide-sheet-and-dispatch [event]
(re-frame/dispatch [:bottom-sheet/hide])

View File

@ -6,8 +6,8 @@
[status-im.ui.components.react :as react]
[status-im.ui.components.icons.vector-icons :as vector-icons]
[status-im.ui.components.styles :as components.styles]
[status-im.ui.components.toolbar.actions :as actions]
[status-im.ui.components.toolbar.view :as toolbar-old]
[status-im.ui.components.list-selection :as list-selection]
[status-im.ui.components.topbar :as topbar]
[status-im.ui.screens.wallet.transactions.styles :as styles]
[quo.core :as quo]
[status-im.ui.components.toolbar :as toolbar])
@ -212,22 +212,23 @@
[details-list-row :t/data data]])
(defn details-action [hash url]
[(actions/opts [{:label (i18n/label :t/copy-transaction-hash)
:action #(react/copy-to-clipboard hash)}
{:label (i18n/label :t/open-on-etherscan)
:action #(.openURL ^js react/linking url)}])])
[{:label (i18n/label :t/copy-transaction-hash)
:action #(react/copy-to-clipboard hash)}
{:label (i18n/label :t/open-on-etherscan)
:action #(.openURL ^js react/linking url)}])
(defview transaction-details-view [hash address]
(letsubs [{:keys [url type confirmations confirmations-progress
date amount-text currency-text]
:as transaction}
:as transaction}
[:wallet.transactions.details/screen hash address]]
[react/view {:style components.styles/flex}
;;TODO options should be replaced by bottom sheet ,and topbar should be used here
[toolbar-old/toolbar {}
toolbar-old/default-nav-back
[toolbar-old/content-title (i18n/label :t/transaction-details)]
(when transaction [toolbar-old/actions (details-action hash url)])]
[topbar/topbar {:title (i18n/label :t/transaction-details)
:right-accessories (when transaction
[{:icon :main-icons/more
:on-press #(list-selection/show {:options
(details-action hash url)})}])}]
[react/scroll-view {:style components.styles/flex}
[details-header date type amount-text currency-text]
[details-confirmations confirmations confirmations-progress (= :failed type)]

View File

@ -140,11 +140,13 @@ class TestBrowsing(SingleDeviceTestCase):
home_view = sign_in.create_user()
daap_view = home_view.dapp_tab_button.click()
browsing_view = daap_view.open_url('https://www.bbc.com')
browsing_view.wait_for_d_aap_to_load()
browsing_view.url_edit_box_lock_icon.click()
browsing_view.find_full_text(connection_is_secure_text)
browsing_view.cross_icon.click()
browsing_view = daap_view.open_url('https://instant.airswap.io')
browsing_view.wait_for_d_aap_to_load()
browsing_view.url_edit_box_lock_icon.click()
browsing_view.find_full_text(connection_is_secure_text)

View File

@ -88,7 +88,7 @@ class OptionsButton(BaseButton):
class AccountOptionsButton(BaseButton):
def __init__(self, driver, account_name):
super(AccountOptionsButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('(//*[@text="%s"]/..//*[@content-desc="icon"])[2]' % account_name)
self.locator = self.Locator.xpath_selector('(//*[@text="%s"]/../..//*[@content-desc="icon"])[2]' % account_name)
class ManageAssetsButton(BaseButton):