fix missing toolbar separator

Signed-off-by: yenda <eric@status.im>
This commit is contained in:
yenda 2019-03-05 08:59:20 +01:00
parent f91a69c6b0
commit 7cad165a66
No known key found for this signature in database
GPG Key ID: 0095623C0069DCE6
48 changed files with 413 additions and 460 deletions

View File

@ -62,9 +62,7 @@
:empty-recent (js/require "./resources/images/ui/empty-recent.png")
:analytics-image (js/require "./resources/images/ui/analytics-image.png")
:welcome-image (js/require "./resources/images/ui/welcome-image.png")
:lock {:image (js/require "./resources/images/ui/lock.png")
:width 993
:height 933}
:lock (js/require "./resources/images/ui/lock.png")
:tribute-to-talk (js/require "./resources/images/ui/tribute-to-talk.png")
:wallet-welcome (js/require "./resources/images/ui/wallet-welcome.png")
:hardwallet-card (js/require "./resources/images/ui/hardwallet-card.png")

View File

@ -50,7 +50,7 @@
(defn chat-icon-view-toolbar [chat-id group-chat name color online]
[chat-icon-view chat-id group-chat name online
{:container styles/container-chat-list
{:container styles/container-chat-toolbar
:online-view-wrapper styles/online-view-wrapper
:online-view styles/online-view
:online-dot-left styles/online-dot-left
@ -58,9 +58,9 @@
:pending-wrapper styles/pending-wrapper
:pending-outer-circle styles/pending-outer-circle
:pending-inner-circle styles/pending-inner-circle
:size 40
:chat-icon styles/chat-icon-chat-list
:default-chat-icon (styles/default-chat-icon-chat-list color)
:size 36
:chat-icon styles/chat-icon-chat-toolbar
:default-chat-icon (styles/default-chat-icon-chat-toolbar color)
:default-chat-icon-text styles/default-chat-icon-text}])
(defn chat-icon-view-chat-list [chat-id group-chat name color online & [hide-dapp?]]

View File

@ -16,6 +16,12 @@
:height 40
:border-radius 20}))
(defn default-chat-icon-chat-toolbar [color]
(merge (default-chat-icon color)
{:width 36
:height 36
:border-radius 18}))
(defn default-chat-icon-profile [color size]
(merge (default-chat-icon color)
{:width size
@ -57,6 +63,12 @@
:height 40
:margin 0}))
(def chat-icon-chat-toolbar
(merge chat-icon
{:width 36
:height 36
:margin 0}))
(defn custom-size-icon [size]
(merge chat-icon
{:width size
@ -154,6 +166,7 @@
{:top 8
:width 4
:height 4}))
(def online-dot-left-profile
(merge online-dot-profile {:left 5}))
(def online-dot-right-profile
@ -167,6 +180,10 @@
{:width 40
:height 40})
(def container-chat-toolbar
{:width 36
:height 36})
(def container-menu-item
{:width 24
:height 24})

View File

@ -86,12 +86,12 @@
[vector-icons/icon :main-icons/next {:color colors/blue}])]])
(defn button [{:keys [on-press label background? uppercase? button-style label-style disabled?] :or {background? true uppercase? true disabled false}}]
[react/touchable-highlight {:on-press on-press
[react/touchable-highlight {:style (styles/button button-style background? disabled?)
:on-press on-press
:disabled disabled?}
[react/view {:style (styles/button button-style background? disabled?)}
[react/text {:uppercase? uppercase?
:style (merge styles/button-label label-style)}
label]]])
[react/text {:uppercase? uppercase?
:style (merge styles/button-label label-style)}
label]])
(defn red-button [props]
[react/view {:align-items :center}

View File

@ -91,11 +91,9 @@
:align-items :center
:justify-content :center})
(defstyle label-action-text
{:padding-right 16
:color colors/blue
:ios {:font-size 15}
:android {:font-size 14}})
(def label-action-text
{:color colors/blue
:font-size 15})
(defstyle logo-shaddow
{:ios {:shadowColor colors/black

View File

@ -38,7 +38,6 @@
[react/view {:style {:width parent-width
:position :absolute
:top -3
:elevation 2
:height 3
:background-color colors/white}}
[react/animated-view {:style {:margin-left anim-x

View File

@ -107,18 +107,20 @@
:icon-opts {:color colors/white}}])
(defn big-list-item
[{:keys [text text-color subtext value action-fn active? destructive? hide-chevron?
[{:keys [style text text-color subtext value action-fn active? destructive? hide-chevron?
accessory-value text-color new?
accessibility-label icon icon-color image-source icon-content]
:or {icon-color colors/blue
text-color colors/black
value ""
active? true}}]
active? true
style {}}}]
{:pre [(or icon image-source)
(and action-fn text)
(or (nil? accessibility-label) (keyword? accessibility-label))]}
[react/touchable-highlight
{:on-press action-fn
:style style
:accessibility-label accessibility-label
:disabled (not active?)}
[react/view (styles/settings-item subtext)

View File

@ -41,10 +41,6 @@
(def account-toolbar
{:background-color colors/white})
(def qr-code
{:flex-grow 1
:justify-content :center})
(def footer
{:flex-direction :row
:justify-content :center})

View File

@ -18,7 +18,10 @@
(defview qr-code-viewer-component [{:keys [style hint-style footer-style footer-button value hint legend]}]
(letsubs [{:keys [width]} [:dimensions/window]
{:keys [snt-amount]} [:tribute-to-talk/settings]]
[react/view {:style (merge styles/qr-code style)}
[react/scroll-view {:content-container-style {:align-items :center
:margin-top 16
:justify-content :center}
:style (merge {:flex 1} style)}
(when snt-amount
[react/view {:style {:margin-horizontal 16}}
[tr-to-talk/enabled-note]])
@ -37,7 +40,9 @@
:selectable true}
legend]]]
(when footer-button
[footer-button value])]))
[react/view {:style {:align-self :stretch
:margin-bottom 16}}
[footer-button value]])]))
(defn qr-code-viewer [{:keys [style hint-style footer-style footer-button value hint legend]
:as params}]

View File

@ -4,18 +4,16 @@
[status-im.utils.platform :as platform])
(:require-macros [status-im.utils.styles :refer [defstyle]]))
(def elevation 2)
(defn- create-status-bar-style [{:keys [background-color bar-style translucent?]
:or {bar-style "light-content"}}]
{:background-color (if translucent? "transparent" background-color)
:translucent translucent?
:bar-style bar-style})
(defn- create-view-style [{:keys [background-color height elevation]
:or {height (get platform/platform-specific :status-bar-default-height)}}]
(defn- create-view-style
[{:keys [background-color height]
:or {height (get platform/platform-specific :status-bar-default-height)}}]
{:background-color background-color
:elevation elevation
:height height})
;; :main
@ -76,8 +74,7 @@
(defstyle view-modal-wallet
{:ios (create-view-style {:background-color colors/blue})
:android (create-view-style {:background-color colors/blue
:height 0
:elevation elevation})})
:height 0})})
;; :transaction
(defstyle status-bar-transaction
@ -105,8 +102,7 @@
:android (create-status-bar-style {:translucent? true})})
(def view-wallet
(create-view-style {:background-color colors/blue
:elevation elevation}))
(create-view-style {:background-color colors/blue}))
;; :default
(defstyle status-bar-default

View File

@ -34,7 +34,8 @@
(defn close [handler]
{:icon :main-icons/close
:handler handler})
:handler handler
:accessibility-label :done-button})
(def default-close
(close default-handler))

View File

@ -7,46 +7,22 @@
(def toolbar-icon-height 24)
(def toolbar-icon-spacing 24)
(defnstyle toolbar [background-color flat?]
(cond->
{:flex 0
:flex-direction :row
:align-items :center
:justify-content :space-between
:elevation (if flat? 0 2)
:android {:height 55}
:ios {:height 56}}
background-color
(assoc :background-color background-color)))
(def toolbar-nav-actions-container
{:flex-direction :row
:margin-left 4})
(defstyle toolbar-container
{:flex 1
:align-items :center})
(def toolbar
{:height 55
:flex 1})
(def toolbar-title-container
{:flex 1
:flex-direction :column
:margin-left 6})
{:justify-content :center
:align-items :center
:flex-direction :column
:margin-left 6})
(defstyle toolbar-title-text
{:color colors/black
:letter-spacing -0.2
:font-size 17
:font-weight :bold
:ios {:text-align :center
:margin-left 15
:margin-right 15}
:android {:text-align :left
:margin-left 22}})
(def toolbar-actions
{:flex 0
:flex-direction :row})
:text-align :center})
(defn toolbar-actions-container [actions-count custom]
(merge {:flex-direction :row}
@ -54,55 +30,39 @@
(when (and (zero? actions-count) (not custom))
{:width (+ toolbar-icon-width toolbar-icon-spacing)})))
(def toolbar-action
{:flex 1
:align-items :center
:justify-content :center})
(def touchable-area
{:width 56
:height 56
:justify-content :center
:align-items :center})
(def action-default
{:width 24
:height 24})
(def nav-item-button
{:margin-horizontal 13})
(defstyle item
{:ios {:padding-horizontal 12
:padding-vertical 16}
:android {:padding 16}})
(def item-text
{:color colors/blue
:font-size 17})
:font-size 15})
(defstyle item-text-action
{:color colors/blue
:ios {:font-size 15
:letter-spacing -0.2}
:android {:font-size 14
:letter-spacing 0.5}})
{:color colors/blue
:font-size 15})
(def toolbar-text-action-disabled {:color colors/gray})
(def item-text-white-background {:color colors/blue})
;;TODO(goranjovic) - Breaks the toolbar title into new line on smaller screens
;;e.g. see Discover > Popular hashtags on iPhone 5s
(def ios-content-item {:position :absolute :right 40 :left 40})
(def icon-add
{:width 24
:height 24
:color colors/blue})
{:width 24
:height 24
:color colors/blue})
(def icon-add-illuminated
{:width 24
:height 24
:color colors/blue
:container-style {:background-color (colors/alpha colors/blue 0.12)
:border-radius 32
:width 32
:height 32
:border-radius 28
:display :flex
:justify-content :center
:align-items :center}})

View File

@ -10,6 +10,7 @@
[status-im.ui.components.toolbar.styles :as styles]
[status-im.utils.platform :as platform]
[status-im.utils.core :as utils]
[status-im.ui.components.colors :as colors]
[status-im.ui.components.common.common :as components.common]))
;; Navigation item
@ -17,7 +18,8 @@
(defn nav-item
[{:keys [handler accessibility-label style] :or {handler #(re-frame/dispatch [:navigate-back])}} item]
[react/touchable-highlight
(merge {:on-press handler}
(merge {:on-press handler
:style styles/touchable-area}
(when accessibility-label
{:accessibility-label accessibility-label}))
[react/view {:style style}
@ -25,13 +27,13 @@
(defn nav-button
[{:keys [icon icon-opts] :as props}]
[nav-item (merge {:style styles/nav-item-button} props)
[nav-item props
[vector-icons/icon icon icon-opts]])
(defn nav-text
([text] (nav-text nil text))
([{:keys [handler] :as props} text]
[react/text (utils/deep-merge {:style (merge styles/item styles/item-text)
[react/text (utils/deep-merge {:style styles/item-text
:on-press (or handler #(re-frame/dispatch [:navigate-back]))}
props)
text]))
@ -45,20 +47,10 @@
(def default-nav-back [nav-button actions/default-back])
(def default-nav-close [nav-button actions/default-close])
(defn default-done
"Renders a touchable icon on Android or a label or iOS."
[{:keys [icon] :as props}]
(if platform/ios?
[react/view
[nav-text props
(i18n/label :t/done)]]
[react/view
[nav-button (merge props {:icon (or icon :main-icons/close)})]]))
;; Content
(defn content-wrapper [content]
[react/view {:style styles/toolbar-container}
[react/view {:style {:flex 1}}
content])
(defn content-title
@ -70,7 +62,9 @@
([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)
:font :toolbar-title :numberOfLines 1 :ellipsizeMode :tail}
:font :toolbar-title
:numberOfLines 1
:ellipsizeMode :tail}
additional-text-props) title]
(when subtitle
[react/text {:style subtitle-style}
@ -79,29 +73,33 @@
;; Actions
(defn text-action [{:keys [style handler disabled? accessibility-label]} title]
[react/text (cond-> {:style (merge styles/item styles/item-text style
(when disabled? styles/toolbar-text-action-disabled))
:on-press (when-not disabled? handler)
:uppercase? true}
accessibility-label
(assoc :accessibility-label 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 (merge styles/item styles/toolbar-action)}])
(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}
[react/view {:style (merge styles/item styles/toolbar-action)}
[react/touchable-highlight {:on-press handler
:style styles/touchable-area}
[react/view
(when overlay-style
[react/view overlay-style])
[vector-icons/icon icon (merge {:container-style styles/action-default} icon-opts)]]])
[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 styles/toolbar-actions}
[react/view {:style {:flex-direction :row}}
(for [{:keys [image icon icon-opts options handler]} v]
(with-meta
(cond (= image :blank)
@ -114,34 +112,60 @@
[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 [background-color style flat?]}
([{:keys [style border-bottom-color transparent? browser? chat?]}
nav-item
content-item
action-items]
[react/view {:style (merge (styles/toolbar background-color flat?) style)}
[react/view styles/ios-content-item
content-item]
(when nav-item
[react/view {:style styles/toolbar-nav-actions-container}
nav-item])
[react/view components.styles/flex]
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
(defn platform-agnostic-toolbar
([props nav-item content-item] (platform-agnostic-toolbar props nav-item content-item [actions [{:image :blank}]]))
([{:keys [background-color style flat?]}
nav-item
content-item
action-items]
[react/view {:style (merge (styles/toolbar background-color flat?) style)}
(when nav-item
[react/view {:style (styles/toolbar-nav-actions-container 0)}
nav-item])
content-item
action-items]))
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]]))
;;TODO remove
(defn simple-toolbar
"A simple toolbar composed of a nav-back item and a single line title."
([] (simple-toolbar nil))

View File

@ -6,16 +6,7 @@
{:flex 1})
(def account-creating-view
{:flex 1
:padding-horizontal 14})
(def account-creating-logo-container
{:margin-top 37
:align-items :center})
(def account-creating-logo
{:size 82
:icon-size 34})
{:flex 1})
(def account-creating-indicatior
{:flex 1
@ -32,10 +23,7 @@
:margin-top 16})
(def logo-container
{:position :absolute
:top 37
:left 0
:right 0
{:margin-top 16
:align-items :center})
(def logo
@ -44,9 +32,7 @@
(defstyle input-container
{:margin-horizontal 16
:margin-top 105
:android {:padding-top 13
:margin-top 92}})
:margin-top 16})
(def input-description
{:font-size 14

View File

@ -45,18 +45,19 @@
password-confirm [:get-in [:accounts/create :password-confirm]]]
[react/keyboard-avoiding-view {:style styles/create-account-view}
[status-bar/status-bar {:flat? true}]
[toolbar/toolbar nil
(when (#{:enter-password :confirm-password} step)
(toolbar/nav-button (actions/back #(re-frame/dispatch [:accounts.create.ui/step-back-pressed step])))) nil]
(when (= :account-creating step)
[react/view styles/account-creating-view
[react/view styles/account-creating-logo-container
[components.common/logo styles/account-creating-logo]]
[react/view styles/logo-container
[components.common/logo styles/logo]]
[react/view {:style styles/account-creating-indicatior}
[components/activity-indicator {:animating true}]
[react/text {:style styles/account-creating-text}
(i18n/label :t/creating-your-account)]]])
(when (#{:enter-password :confirm-password :enter-name} step)
[react/view components.styles/flex
[toolbar/toolbar {:flat? true} (when (#{:enter-password :confirm-password} step)
(toolbar/nav-button (actions/back #(re-frame/dispatch [:accounts.create.ui/step-back-pressed step])))) nil]
[react/scroll-view {:flex 1}
[react/view {:style styles/logo-container}
[components.common/logo styles/logo]]
^{:key (str "step" step)}
@ -69,11 +70,11 @@
:password password
:password-confirm password-confirm}]
[react/text {:style styles/input-description}
(get-in steps [step :input-description])]]
[react/view {:style components.styles/flex}]
[react/view {:style styles/bottom-container}
[react/view {:style components.styles/flex}]
[components.common/bottom-button
{:forward? true
:disabled? (not next-enabled?)
:on-press #(re-frame/dispatch [:accounts.create.ui/next-step-pressed step password password-confirm])}]]]])]))
(get-in steps [step :input-description])]]]])
(when (#{:enter-password :confirm-password :enter-name} step)
[react/view {:style styles/bottom-container}
[react/view {:style components.styles/flex}]
[components.common/bottom-button
{:forward? true
:disabled? (not next-enabled?)
:on-press #(re-frame/dispatch [:accounts.create.ui/next-step-pressed step password password-confirm])}]])]))

View File

@ -63,7 +63,6 @@
[react/keyboard-avoiding-view {:style ast/accounts-view}
[status-bar/status-bar]
[login-toolbar can-navigate-back?]
[components.common/separator]
[react/scroll-view styles/login-view
[react/view styles/login-badge-container
[account-login-badge photo-path name]

View File

@ -75,7 +75,6 @@
[status-bar/status-bar]
[toolbar/toolbar nil toolbar/default-nav-back
[toolbar/content-title (i18n/label :t/sign-in-to-another)]]
[components.common/separator]
[react/view styles/inputs-container
[passphrase-input (or passphrase "") passphrase-error passphrase-warning]
[password-input (or password "") password-error (when-not disabled? sign-in)]

View File

@ -62,29 +62,40 @@
(def web-view-error-text
{:color colors/gray})
(defnstyle toolbar-content [show-actions]
(def toolbar-content
{:flex-direction :row
:flex 1
:border-radius 4
:height 36
:border-radius 8
:max-height 36
:background-color colors/gray-lighter
:padding-horizontal 12
:margin-right 5
:margin-right 8
:align-items :center
:android {:margin-left (if show-actions 66 20)}
:ios {:margin-left 20}})
:align-self :center
:margin-top 10
:margin-left 56})
(defstyle url-input
{:flex 1
:font-size 14
:letter-spacing -0.2
:margin-horizontal 5
:android {:padding 0}})
{:flex 1
:font-size 15
:line-height 22
:text-align-vertical :center
:android {:margin 0
:padding 0
:margin-left 6}
:ios {:margin-top -6
:min-height 26
:margin-left 6}})
(def url-text-container
{:justify-content :center
:flex 1
:margin-horizontal 5})
(def url-text
{:font-size 14
:letter-spacing -0.2
:margin-horizontal 5})
{:font-size 15
:line-height 22
:letter-spacing -0.2})
(def dot
{:height 4

View File

@ -31,42 +31,35 @@
(defn toolbar-content [url url-original {:keys [secure?]} url-editing?]
(let [url-text (atom url)]
[react/view
[react/view (styles/toolbar-content false)
[react/touchable-highlight {:on-press #(re-frame/dispatch [:browser.ui/lock-pressed secure?])}
(if secure?
[icons/icon :tiny-icons/tiny-lock {:color colors/green}]
[icons/icon :tiny-icons/tiny-lock-broken])]
(if url-editing?
[react/text-input {:on-change-text #(reset! url-text %)
:on-blur #(re-frame/dispatch [:browser.ui/url-input-blured])
:on-submit-editing #(re-frame/dispatch [:browser.ui/url-submitted @url-text])
:placeholder (i18n/label :t/enter-url)
:auto-capitalize :none
:auto-correct false
:auto-focus true
:default-value url
:ellipsize :end
:style styles/url-input}]
[react/touchable-highlight {:style {:flex 1} :on-press #(re-frame/dispatch [:browser.ui/url-input-pressed])}
[react/text {:style styles/url-text} (http/url-host url-original)]])]]))
(defn- on-options [name browser-id]
(list-selection/show {:title name
:options (wallet.actions/actions browser-id)}))
[react/view styles/toolbar-content
[react/touchable-highlight {:on-press #(re-frame/dispatch [:browser.ui/lock-pressed secure?])}
(if secure?
[icons/icon :tiny-icons/tiny-lock {:color colors/green}]
[icons/icon :tiny-icons/tiny-lock-broken])]
(if url-editing?
[react/text-input {:on-change-text #(reset! url-text %)
:on-blur #(re-frame/dispatch [:browser.ui/url-input-blured])
:on-submit-editing #(re-frame/dispatch [:browser.ui/url-submitted @url-text])
:placeholder (i18n/label :t/enter-url)
:auto-capitalize :none
:auto-correct false
:auto-focus true
:default-value url
:ellipsize :end
:style styles/url-input}]
[react/touchable-highlight {:style styles/url-text-container
:on-press #(re-frame/dispatch [:browser.ui/url-input-pressed])}
[react/text {:style styles/url-text} (http/url-host url-original)]])]))
(defn toolbar [error? url url-original browser browser-id url-editing?]
[toolbar.view/toolbar {}
[toolbar.view/toolbar
{:browser? true}
[toolbar.view/nav-button
(actions/close (fn []
(re-frame/dispatch [:navigate-to :home])
(when error?
(re-frame/dispatch [:browser.ui/remove-browser-pressed browser-id]))))]
[toolbar-content url url-original browser url-editing?]
[toolbar.view/actions [{:icon :main-icons/more
:icon-opts {:color :black
:accessibility-label :chat-menu-button}
:handler #(on-options name browser-id)}]]])
(actions/back (fn []
(re-frame/dispatch [:navigate-to :home])
(when error?
(re-frame/dispatch [:browser.ui/remove-browser-pressed browser-id]))))]
[toolbar-content url url-original browser url-editing?]])
(defn- web-view-error [_ code desc]
(reagent/as-element
@ -82,7 +75,7 @@
(let [domain-name (nth (re-find #"^\w+://(www\.)?([^/:]+)" url) 2)]
(get (:inject-js browser-config) domain-name))))
(defn navigation [url webview can-go-back? can-go-forward?]
(defn navigation [browser-id url webview can-go-back? can-go-forward?]
[react/view styles/navbar
[react/touchable-highlight {:on-press #(re-frame/dispatch [:browser.ui/previous-page-button-pressed])
:disabled (not can-go-back?)
@ -100,6 +93,10 @@
{:on-press #(re-frame/dispatch [:browser.ui/open-modal-chat-button-pressed (http/url-host url)])
:accessibility-label :modal-chat-button}
[icons/icon :main-icons/message]]
[react/touchable-highlight
{:on-press #(wallet.actions/share-link browser-id)
:accessibility-label :modal-share-link-button}
[icons/icon :main-icons/share]]
[react/touchable-highlight {:on-press #(.reload @webview)
:accessibility-label :refresh-page-button}
[icons/icon :main-icons/refresh]]])
@ -142,7 +139,7 @@
(str network-id)))
(get-inject-js url))
:injected-java-script js-res/webview-js}])]
[navigation url-original webview can-go-back? can-go-forward?]
[navigation browser-id url-original webview can-go-back? can-go-forward?]
[permissions.views/permissions-panel [(:dapp? browser) (:dapp browser)] show-permission]
(when show-tooltip
[tooltip/bottom-tooltip-info

View File

@ -12,21 +12,13 @@
(def toolbar-container
{:flex 1
:flex-direction :row
:align-items :stretch
:margin-left 3})
:flex-direction :row})
(def messages-container
{:flex 1
:padding-bottom 0
:margin-bottom 0})
(def toolbar-view
{:flex-direction :row
:height 56
:background-color colors/white
:elevation 2})
(def action
{:width 56
:height 56
@ -50,15 +42,14 @@
(def chat-name-view
{:flex 1
:justify-content :center
:margin-bottom 2})
:justify-content :center})
(defstyle chat-name-text
{:color colors/black
:android {:font-size 15
:line-height 20}
:ios {:font-size 16
:line-height 22}})
(def chat-name-text
{:color colors/black
:font-size 15
:font-weight "500"
:line-height 22
:margin-top -3})
(def group-icon
{:margin-top 4
@ -69,8 +60,7 @@
(defstyle toolbar-subtitle
{:color colors/text-gray
:line-height 15
:font-size 13
:ios {:margin-top 4}})
:font-size 12})
(defstyle last-activity-text
{:color colors/text-gray

View File

@ -70,7 +70,6 @@
[react/view {:style st/chat-name-view}
[react/text {:style st/chat-name-text
:number-of-lines 1
:font :toolbar-title
:accessibility-label :chat-name-text}
chat-name]
(if group-chat

View File

@ -56,7 +56,8 @@
(letsubs [{:keys [chat-name group-chat chat-id contact]} [:chats/current-chat]]
[react/view
[status-bar/status-bar (when modal? {:type :modal-white})]
[toolbar/platform-agnostic-toolbar {}
[toolbar/toolbar
{:chat? true}
(if modal?
[toolbar/nav-button
(toolbar.actions/close toolbar.actions/default-handler)]

View File

@ -18,20 +18,20 @@
(defview contacts-list []
(letsubs [blocked-contacts-count [:contacts/blocked-count]
contacts [:contacts/active]]
[react/view {:flex 1
:background-color colors/white}
[status-bar/status-bar]
[toolbar.view/simple-toolbar (i18n/label :t/contacts)]
[react/scroll-view {:style {:background-color colors/white
:padding-top 16}}
[react/view {:flex 1}
[status-bar/status-bar {:type :main}]
[toolbar.view/toolbar nil
toolbar.view/default-nav-back
(toolbar.view/content-title (i18n/label :t/contacts))]
[react/scroll-view {:flex 1}
[list.views/big-list-item
{:text (i18n/label :t/blocked-users)
{:style {:margin-vertical 16}
:text (i18n/label :t/blocked-users)
:icon :main-icons/cancel
:icon-color colors/red
:accessibility-label :blocked-users-list-button
:accessory-value blocked-contacts-count
:action-fn #(re-frame/dispatch [:navigate-to :blocked-users-list])}]
[react/view {:height 16}]
[list.views/flat-list
{:data contacts
:key-fn :address

View File

@ -154,9 +154,6 @@
:android {:top 2}
:ios {:top 3}})
(def container
{:flex 1})
(def group-icon
{:margin-top 8
:margin-right 6
@ -206,7 +203,7 @@
:color colors/gray})
(def toolbar-logo
{:size 42
{:size 40
:icon-size 17
:shadow? false})

View File

@ -36,8 +36,7 @@
(if sync-state
(str "syncing " (:currentBlock sync-state) " of " (:highestBlock sync-state) " blocks...")
(str "not syncing")))]]]
[toolbar/content-wrapper
[components.common/logo styles/toolbar-logo]]))
[components.common/logo styles/toolbar-logo]))
(cond
(and platform/ios?
logged-in?)
@ -293,9 +292,10 @@
(utils/set-timeout
#(re-frame/dispatch [:init-rest-of-chats])
100))))}
[react/view styles/container
[react/view {:flex 1}
[status-bar/status-bar {:type :main}]
[react/keyboard-avoiding-view {:style (assoc styles/container :background-color :white)}
[react/keyboard-avoiding-view {:style {:flex 1
:background-color :white}}
[toolbar show-welcome? (and network-initialized? (not rpc-network?))
sync-state latest-block-number (not logging-in?)]
(cond show-welcome?

View File

@ -19,24 +19,19 @@
(defn group-chat-profile-toolbar [admin?]
[toolbar/toolbar {}
toolbar/default-nav-back
[toolbar/content-title ""]
nil
(when admin?
[react/touchable-highlight
{:on-press #(re-frame/dispatch [:group-chat-profile/start-editing])}
[react/view
[react/text {:style common.styles/label-action-text
:uppercase? true
:accessibility-label :edit-button}
(i18n/label :t/edit)]]])])
[toolbar/text-action {:handler #(re-frame/dispatch [:group-chat-profile/start-editing])
:accessibility-label :edit-button}
(i18n/label :t/edit)])])
(defn group-chat-profile-edit-toolbar []
[toolbar/toolbar {}
nil
[toolbar/content-title ""]
[toolbar/default-done {:handler #(re-frame/dispatch [:group-chats.ui/save-pressed])
:icon :main-icons/check
:icon-opts {:color colors/blue
:accessibility-label :done-button}}]])
nil
[toolbar/text-action {:handler #(re-frame/dispatch [:group-chats.ui/save-pressed])
:accessibility-label :done-button}
(i18n/label :t/done)]])
(defn actions [allow-adding-members? chat-id]
(concat

View File

@ -72,7 +72,10 @@
(accounts.update/account-update cleaned-edit {}))))
(defn start-editing-group-chat-profile [{:keys [db]}]
{:db (assoc db :group-chat-profile/editing? true)})
(let [current-chat-name (get-in db [:chats (:current-chat-id db) :name])]
{:db (-> db
(assoc :group-chat-profile/editing? true)
(assoc-in [:group-chat-profile/profile :name] current-chat-name))}))
(defn enter-two-random-words [{:keys [db]}]
(let [{:keys [mnemonic]} (:account/account db)

View File

@ -2,32 +2,28 @@
(:require [status-im.ui.components.colors :as colors]
[status-im.ui.components.styles :as common.styles]))
(def intro-container
{:flex 1
:align-items :center
:justify-content :center
:margin-horizontal 26})
(def intro-image
{:padding-bottom 10
:align-items :center})
{:margin-top 16
:width 248
:height 233
:align-items :center})
(def intro-text
{:text-align :center
:font-size 22
:font-weight :bold
:line-height 28
:letter-spacing -0.3})
{:text-align :center
:font-size 22
:font-weight :bold
:line-height 28
:margin-vertical 16})
(def intro-description
{:margin-top 8
:line-height 21
:text-align :center
:color colors/gray})
{:margin-top 8
:line-height 21
:text-align :center
:color colors/gray})
(def intro-button
{:flex-direction :row
:margin-top 16})
{:flex-direction :row
:margin-vertical 16})
(def six-words-container
{:flex 1
@ -154,8 +150,3 @@
:font-size 14
:text-align :center
:color colors/gray})
(def backup-seed-container
(merge
common.styles/flex
{:background-color colors/white}))

View File

@ -36,17 +36,20 @@
:second-word (re-frame/dispatch [:my-profile/set-step :first-word])))
(defn intro []
[react/view {:style styles/intro-container}
[react/scroll-view {:style {:padding-horizontal 16}
:content-container-style {:align-items :center
:justify-content :center}}
(when-not platform/desktop?
[components.common/image-contain {:container-style styles/intro-image}
(:lock resources/ui)])
[react/image {:source (:lock resources/ui)
:style styles/intro-image}])
[react/i18n-text {:style styles/intro-text
:key :your-data-belongs-to-you}]
[react/i18n-text {:style styles/intro-description
:key :your-data-belongs-to-you-description}]
[components.common/button {:button-style styles/intro-button
:on-press #(re-frame/dispatch [:set-in [:my-profile/seed :step] :12-words])
:label (i18n/label :t/ok-continue)}]])
[components.common/button
{:button-style styles/intro-button
:on-press #(re-frame/dispatch [:set-in [:my-profile/seed :step] :12-words])
:label (i18n/label :t/ok-continue)}]])
(defn six-words [words]
[react/view {:style styles/six-words-container}
@ -139,7 +142,7 @@
(defview backup-seed []
(letsubs [current-account [:account/account]
{:keys [step first-word second-word error word]} [:my-profile/recovery]]
[react/keyboard-avoiding-view {:style styles/backup-seed-container}
[react/keyboard-avoiding-view {:style {:flex 1}}
[status-bar/status-bar]
[toolbar/toolbar
nil
@ -150,7 +153,6 @@
(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})]]]
[components.common/separator]
(case step
:intro [intro]
:12-words [twelve-words current-account]

View File

@ -12,10 +12,6 @@
(def share-contact-code-button
{:height 42})
(def qr-toolbar
{:border-bottom-color colors/gray-light
:border-bottom-width 1})
(def qr-code
{:background-color colors/white})

View File

@ -14,6 +14,8 @@
[status-im.ui.components.react :as react]
[status-im.ui.components.status-bar.view :as status-bar]
[status-im.ui.components.toolbar.view :as toolbar]
[status-im.ui.components.toolbar.actions :as toolbar.actions]
[status-im.ui.components.toolbar.styles :as toolbar.styles]
[status-im.ui.screens.profile.components.views :as profile.components]
[status-im.ui.screens.profile.components.styles :as profile.components.styles]
[status-im.ui.screens.profile.user.styles :as styles]
@ -28,27 +30,27 @@
[status-im.utils.universal-links.core :as universal-links]))
(defn my-profile-toolbar []
[toolbar/toolbar {}
[toolbar/toolbar
{}
nil
[toolbar/content-title ""]
[react/touchable-highlight
{:on-press #(re-frame/dispatch [:my-profile/start-editing-profile])
nil
[toolbar/text-action
{:handler #(re-frame/dispatch [:my-profile/start-editing-profile])
:accessibility-label :edit-button}
[react/view
[react/text {:style common.styles/label-action-text
:uppercase? true}
(i18n/label :t/edit)]]]])
(i18n/label :t/edit)]])
(defn my-profile-edit-toolbar [on-show]
(reagent/create-class
{:component-did-mount on-show
:reagent-render (fn [] [toolbar/toolbar {}
nil
[toolbar/content-title ""]
[toolbar/default-done {:handler #(re-frame/dispatch [:my-profile/save-profile])
:icon :main-icons/check
:icon-opts {:color colors/blue}
:accessibility-label :done-button}]])}))
:reagent-render (fn []
[toolbar/toolbar
{}
nil
nil
[toolbar/text-action
{:handler #(re-frame/dispatch [:my-profile/save-profile])
:accessibility-label :done-button}
(i18n/label :t/done)]])}))
(def profile-icon-options
[{:label (i18n/label :t/image-source-gallery)
@ -68,9 +70,9 @@
:action #(re-frame/dispatch [:my-profile/remove-current-photo])}))
(defn qr-viewer-toolbar [label value]
[toolbar/toolbar {:style styles/qr-toolbar}
[toolbar/default-done {:icon-opts {:color colors/black}
:accessibility-label :done-button}]
[toolbar/toolbar nil
(toolbar/nav-button
(toolbar.actions/close toolbar.actions/default-handler))
[toolbar/content-title label]])
(defn qr-code-share-button [value]
@ -227,7 +229,7 @@
(defview advanced [params on-show]
(letsubs [advanced? [:get :my-profile/advanced?]]
{:component-will-unmount #(re-frame/dispatch [:set :my-profile/advanced? false])}
[react/view
[react/view {:padding-bottom 16}
[react/touchable-highlight {:on-press #(re-frame/dispatch [:set :my-profile/advanced? (not advanced?)])
:style styles/advanced-button}
[react/view {:style styles/advanced-button-container}
@ -293,7 +295,7 @@
(js/setTimeout
#(.scrollToEnd @scroll {:animated false})
300))]
[react/view {:flex 1}
[react/keyboard-avoiding-view {:style {:flex 1}}
[status-bar/status-bar {:type :main}]
[react/view profile.components.styles/profile
(if editing?
@ -319,7 +321,4 @@
[react/view styles/my-profile-info-container
[my-profile-settings current-account shown-account currency (nil? login-data)]]
(when (nil? login-data)
[advanced shown-account on-show-advanced])
[react/view
{:align-self :stretch
:height 16}]]]])))
[advanced shown-account on-show-advanced])]]])))

View File

@ -4,7 +4,7 @@
[status-im.utils.universal-links.core :as universal-links]
[status-im.ui.components.list-selection :as list-selection]))
(defn- share-link [browser-id]
(defn share-link [browser-id]
(let [link (universal-links/generate-link :browse :external browser-id)
message (i18n/label :t/share-dapp-text {:link link})]
(list-selection/open-share {:message message})))

View File

@ -1,9 +1,6 @@
(ns status-im.ui.screens.wallet.choose-recipient.styles
(:require [status-im.ui.components.colors :as colors]))
(def toolbar
{:background-color :transparent})
(def wallet-container
{:flex 1
:background-color colors/blue})
@ -83,11 +80,11 @@
(def qr-code
{:flex 1
:background-color colors/white-transparent
:align-items :center})
:align-items :stretch})
(defn qr-code-text [dimensions]
{:zIndex 1
:padding-top 20
:color :white
:text-align :center
:width (int (/ (:width dimensions) 2))})
{:zIndex 1
:padding-top 16
:color :white
:text-align :center
:padding-vertical 16})

View File

@ -9,11 +9,13 @@
[status-im.ui.components.status-bar.view :as status-bar]
[status-im.ui.components.toolbar.actions :as actions]
[status-im.ui.components.toolbar.view :as toolbar]
[status-im.ui.components.colors :as colors]
[status-im.ui.screens.wallet.choose-recipient.styles :as styles]
[status-im.utils.platform :as platform]))
(defn- toolbar-view [camera-flashlight]
[toolbar/toolbar styles/toolbar
[toolbar/toolbar
{:transparent? true}
[toolbar/nav-button (actions/back-white actions/default-handler)]
[toolbar/content-title {:color :white}
(i18n/label :t/wallet-choose-recipient)]

View File

@ -49,8 +49,7 @@
([props title] (toolbar props default-action title))
([props action title] (toolbar props action title nil))
([props action title options]
[toolbar/toolbar (utils.core/deep-merge {:style wallet.styles/toolbar}
props)
[toolbar/toolbar (assoc-in props [:style :border-bottom-color] colors/white-light-transparent)
[toolbar/nav-button action]
[toolbar/content-title {:color :white :font-weight "700"}
title]
@ -223,7 +222,7 @@
(let [content (reagent/atom nil)]
(fn []
[simple-screen {:avoid-keyboard? true}
[toolbar {:style wallet.styles/toolbar-bottom-line}
[toolbar {:style {:border-bottom-color colors/white-light-transparent}}
default-action
(i18n/label :t/recipient)]
[react/view components.styles/flex

View File

@ -133,6 +133,15 @@
(fn [cofx _]
(models/update-wallet cofx)))
(handlers/register-handler-fx
:update-wallet-and-nav-back
(fn [cofx [_ on-close]]
(fx/merge cofx
(when on-close
{:dispatch on-close})
(navigation/navigate-back)
(models/update-wallet))))
(handlers/register-handler-fx
:update-transactions
(fn [{:keys [db]} _]
@ -230,7 +239,7 @@
(assoc-in db-with-adjusted-gas [:wallet :send-transaction :original-gas] adjusted-gas))}))))
(handlers/register-handler-fx
:wallet-setup-navigate-back
:wallet.setup-ui/navigate-back-pressed
(fn [{:keys [db] :as cofx}]
(fx/merge cofx
{:db (assoc-in db [:wallet :send-transaction] {})}

View File

@ -5,9 +5,8 @@
;; Main section
(defstyle main-section
{:flex 1
:android {:background-color colors/white}
:ios {:background-color colors/blue}})
{:flex 1
:background-color colors/blue})
(defstyle scroll-bottom
{:background-color colors/white
@ -18,22 +17,14 @@
:android {:height 0}
:ios {:height 9999}})
(def section
{:background-color colors/blue})
(def backup-seed-phrase-container
{:flex-direction :row
:align-items :center
:border-radius 8
:margin 16
:background-color colors/black-transparent
:padding-top 10
:padding-bottom 10
:padding-left 14
:padding-right 12})
(def backup-seed-phrase-text-container
{:flex 1})
{:flex-direction :row
:background-color colors/black-transparent
:margin 16
:border-radius 8
:padding-top 10
:padding-bottom 10
:padding-horizontal 16})
(def backup-seed-phrase-title
{:font-size 15
@ -45,13 +36,12 @@
:color colors/white-transparent})
(def total-balance-container
{:align-items :center
:justify-content :center
:padding-top 49
:padding-bottom 38})
(def total-balance
{:flex-direction :row})
{:align-items :center
:justify-content :center
:padding-top 49
:padding-bottom 38
:background-color colors/blue
:flex-direction :row})
(def total-balance-value
{:font-size 32
@ -78,9 +68,6 @@
;; Actions section
(def action-section
{:background-color colors/blue})
(def action
{:background-color colors/white-transparent
:width 40
@ -144,11 +131,9 @@
:line-height 20})
(def address-section
(merge
section
{:flex-grow 1
:align-items :center
:padding 20}))
{:flex-grow 1
:align-items :center
:padding 20})
(def modal-history
{:flex 1

View File

@ -14,6 +14,7 @@
[status-im.ui.screens.wallet.settings.views :as settings]
[status-im.ui.screens.wallet.utils :as wallet.utils]
[status-im.utils.money :as money]
[status-im.utils.platform :as platform]
[status-im.ui.components.toolbar.actions :as action]
status-im.ui.screens.wallet.collectibles.etheremon.views
status-im.ui.screens.wallet.collectibles.cryptostrikers.views
@ -26,7 +27,7 @@
(defn toolbar-modal [modal-history?]
[react/view
[status-bar.view/status-bar {:type :modal-wallet}]
[toolbar/toolbar {:style wallet.styles/toolbar :flat? true}
[toolbar/toolbar {:transparent? true}
[toolbar/nav-button (action/close-white action/default-handler)]
[toolbar/content-wrapper]
[toolbar/actions
@ -36,31 +37,33 @@
:handler #(re-frame/dispatch [:set-in [:wallet :modal-history?] (not modal-history?)])}]]]])
(defn- total-section [value currency]
[react/view styles/section
[react/view {:style styles/total-balance-container}
[react/view {:style styles/total-balance}
[react/text {:style styles/total-balance-value
:accessibility-label :total-amount-value-text}
(when (and
(not= "0" value)
(not= "..." value))
[react/text {:style styles/total-balance-tilde}
"~"])
value]
[react/text {:style styles/total-balance-currency
:accessibility-label :total-amount-currency-text}
(:code currency)]]]])
[react/view {:style styles/total-balance-container}
[react/text {:style styles/total-balance-value
:accessibility-label :total-amount-value-text}
(when (and
(not= "0" value)
(not= "..." value))
[react/text {:style styles/total-balance-tilde}
"~"])
value]
[react/text {:style styles/total-balance-currency
:accessibility-label :total-amount-currency-text}
(:code currency)]])
(defn- backup-seed-phrase []
[react/view styles/section
[react/touchable-highlight {:on-press #(re-frame/dispatch [:navigate-to :backup-seed])}
[react/view styles/backup-seed-phrase-container
[react/view styles/backup-seed-phrase-text-container
[react/i18n-text {:style styles/backup-seed-phrase-title
:key :wallet-backup-recovery-title}]
[react/i18n-text {:style styles/backup-seed-phrase-description
:key :wallet-backup-recovery-description}]]
[vector-icons/icon :main-icons/next {:color :white}]]]])
[react/touchable-highlight {:on-press #(re-frame/dispatch [:navigate-to :backup-seed])
:style {:background-color colors/blue}
:underlay-color colors/blue}
[react/view {:style styles/backup-seed-phrase-container}
[react/view
[react/i18n-text {:style styles/backup-seed-phrase-title
:key :wallet-backup-recovery-title}]
[react/i18n-text {:style styles/backup-seed-phrase-description
:key :wallet-backup-recovery-description}]]
[react/view {:style {:flex 1}}]
[react/view {:style {:align-items :center
:justify-content :center}}
[vector-icons/icon :main-icons/next {:color colors/white}]]]])
(def actions
[{:label (i18n/label :t/wallet-send)
@ -129,22 +132,22 @@
(defn- asset-section [assets currency address-hex]
(let [{:keys [tokens nfts]} (group-assets assets)]
[react/view styles/asset-section
[list/section-list
{:scroll-enabled false
:key-fn (comp str :symbol)
:render-section-header-fn (fn [{:keys [title data]}]
(when (not-empty data)
[react/text {:style styles/asset-section-header}
title]))
:sections [{:title (i18n/label :t/wallet-assets)
:key :assets
:data tokens
:render-fn (render-asset currency)}
{:title (i18n/label :t/wallet-collectibles)
:key :collectibles
:data nfts
:render-fn #(render-collectible address-hex %)}]}]]))
[list/section-list
{:scroll-enabled false
:style styles/asset-section
:key-fn (comp str :symbol)
:render-section-header-fn (fn [{:keys [title data]}]
(when (not-empty data)
[react/text {:style styles/asset-section-header}
title]))
:sections [{:title (i18n/label :t/wallet-assets)
:key :assets
:data tokens
:render-fn (render-asset currency)}
{:title (i18n/label :t/wallet-collectibles)
:key :collectibles
:data nfts
:render-fn #(render-collectible address-hex %)}]}]))
(defn snackbar [error-message]
[react/view styles/snackbar-container
@ -161,7 +164,8 @@
[react/view styles/main-section
[status-bar.view/status-bar {:type :wallet-tab}]
[settings/toolbar-view]
[react/scroll-view {:refresh-control
[react/scroll-view {:end-fill-color colors/white
:refresh-control
(reagent/as-element
[react/refresh-control {:on-refresh #(re-frame/dispatch [:wallet.ui/pull-to-refresh])
:tint-color :white
@ -175,14 +179,14 @@
(and amount (not (.isZero amount))))
assets))
[backup-seed-phrase])
[react/view (merge {:background-color colors/blue} styles/action-section)
[react/view {:style {:background-color colors/blue}}
[list/flat-list
{:data actions
:key-fn (fn [_ i] (str i))
:render-fn #(list/render-action % {:action-label-style {:font-size 17}})}]]
[asset-section assets currency address-hex]
;; Hack to allow different colors for bottom scroll view (iOS only)
[react/view {:style styles/scroll-bottom}]]]))
(when platform/ios?
[react/view {:style styles/scroll-bottom}])]]))
(views/defview wallet []
(views/letsubs [{:keys [wallet-set-up-passed?]} [:account/account]]

View File

@ -3,8 +3,6 @@
(def border-top-justify
{:justify-content :space-between
:border-top-color colors/white-light-transparent
:border-top-width 1
:flex 1})
(def signing-phrase

View File

@ -56,8 +56,8 @@
(defn toolbar []
^{:key "toolbar"}
[wallet.components/toolbar
{}
(actions/back-white #(re-frame/dispatch [:wallet-setup-navigate-back]))
{:transparent? true}
(actions/back-white #(re-frame/dispatch [:wallet.setup-ui/navigate-back-pressed]))
(i18n/label :t/wallet-set-up-title)])
(defn main-panel [signing-phrase on-confirm]

View File

@ -77,7 +77,7 @@
(views/letsubs [address-hex [:account/hex-address]
chain-id [:get-network-id]]
[wallet.components/simple-screen
[wallet.components/toolbar {}
[wallet.components/toolbar {:transparent? true}
wallet.components/default-action
(i18n/label :t/receive)
[toolbar/actions [{:icon :main-icons/share

View File

@ -33,7 +33,7 @@
(defn- toolbar [modal? title]
(let [action (if modal? actions/close-white actions/back-white)]
[toolbar/toolbar {:style wallet.styles/toolbar}
[toolbar/toolbar {:transparent? true}
[toolbar/nav-button (action (if modal?
#(re-frame/dispatch [:wallet/discard-transaction-navigate-back])
#(actions/default-handler)))]
@ -237,4 +237,4 @@
[status-bar/status-bar {:type :modal-wallet}]
[toolbar true (i18n/label :t/send-transaction)]
[react/i18n-text {:style styles/empty-text
:key :unsigned-transaction-expired}]]])))
:key :unsigned-transaction-expired}]]])))

View File

@ -8,6 +8,7 @@
[status-im.ui.components.react :as react]
[status-im.ui.components.styles :as components.styles]
[status-im.ui.components.toolbar.view :as toolbar]
[status-im.ui.components.toolbar.actions :as toolbar.actions]
[status-im.ui.components.status-bar.view :as status-bar]
[status-im.ui.screens.wallet.styles :as wallet.styles]
[status-im.utils.ethereum.core :as ethereum]
@ -44,12 +45,11 @@
all-tokens [:wallet/all-tokens]]
[react/view (merge components.styles/flex {:background-color :white})
[status-bar/status-bar {:type :modal-wallet}]
[toolbar/toolbar {:style wallet.styles/toolbar}
[toolbar/nav-text {:handler #(do (re-frame/dispatch [:update-wallet])
(re-frame/dispatch [:navigate-back]))
:style {:color colors/white}
:accessibility-label :done-button}
(i18n/label :t/done)]
[toolbar/toolbar
{:style {:background-color colors/blue
:border-bottom-width 0}}
[toolbar/nav-button
(toolbar.actions/close-white #(re-frame/dispatch [:update-wallet-and-nav-back]))]
[toolbar/content-title {:color colors/white}
(i18n/label :t/wallet-assets)]]
[react/view {:style components.styles/flex}
@ -65,11 +65,13 @@
{address :address} [:account/account]]
[react/keyboard-avoiding-view {:style {:flex 1 :background-color colors/blue}}
[status-bar/status-bar {:type :wallet}]
[toolbar/toolbar {:style wallet.styles/toolbar}
[toolbar/nav-button (actions/back-white #(do (when on-close
(re-frame/dispatch (on-close (create-payload address))))
(re-frame/dispatch [:update-wallet])
(re-frame/dispatch [:navigate-back])))]
[toolbar/toolbar
{:style {:border-bottom-color colors/white-light-transparent}}
[toolbar/nav-button
(actions/back-white
#(re-frame/dispatch [:update-wallet-and-nav-back
(when on-close
(on-close (create-payload address)))]))]
[toolbar/content-title {:color colors/white}
label]]
[view (create-payload address)]]))
@ -84,7 +86,7 @@
(defview toolbar-view []
(letsubs [settings [:wallet/settings]
{address :address} [:account/account]]
[toolbar/toolbar {:style wallet.styles/toolbar :flat? true}
[toolbar/toolbar {:transparent? true}
nil
[toolbar/content-wrapper]
[toolbar/actions

View File

@ -23,7 +23,8 @@
(defn- toolbar [modal? title]
(let [action (if modal? actions/close-white actions/back-white)]
[toolbar/toolbar {:style wallet.styles/toolbar}
[toolbar/toolbar
{:style {:border-bottom-color colors/white-light-transparent}}
[toolbar/nav-button (action (if modal?
#(re-frame/dispatch [:wallet/discard-transaction-navigate-back])
#(actions/default-handler)))]

View File

@ -4,13 +4,6 @@
;; wallet
(def toolbar
{:background-color colors/blue})
(defstyle toolbar-bottom-line
{:ios {:border-bottom-width 1
:border-bottom-color colors/white-transparent}})
(defn button-container [enabled?]
(merge {:flex-direction :row
:align-items :center}

View File

@ -15,10 +15,12 @@
[status-im.utils.money :as money]
[status-im.utils.ethereum.tokens :as tokens]
[status-im.utils.ethereum.core :as ethereum]
[status-im.ui.components.colors :as colors]
[status-im.ui.screens.wallet.utils :as wallet.utils]))
(defn- toolbar [title]
[toolbar/toolbar {:style wallet.styles/toolbar}
[toolbar/toolbar
{:style {:border-bottom-color colors/white-light-transparent}}
[toolbar/nav-button (act/close-white act/default-handler)]
[toolbar/content-title {:color :white} title]])

View File

@ -90,7 +90,7 @@ class TestWalletManagement(SingleDeviceTestCase):
deselect_asset = 'STT'
wallet.asset_checkbox_by_name(select_asset).click()
wallet.asset_checkbox_by_name(deselect_asset).click()
wallet.done_button.click()
wallet.cross_icon.click()
wallet.asset_by_name(select_asset).scroll_to_element()
if not wallet.asset_by_name(select_asset).is_element_displayed():
self.errors.append('%s asset is not shown in wallet' % select_asset)
@ -131,7 +131,7 @@ class TestWalletManagement(SingleDeviceTestCase):
wallet.manage_assets_button.click()
asset_name = 'CryptoKitties'
wallet.asset_checkbox_by_name(asset_name).click()
wallet.done_button.click()
wallet.cross_icon.click()
send_transaction = wallet.send_transaction_button.click()
send_transaction.select_asset_button.click()
if send_transaction.asset_by_name(asset_name).is_element_displayed():

View File

@ -65,8 +65,7 @@ class URLEditBoxLockIcon(BaseEditBox):
def __init__(self, driver):
super(URLEditBoxLockIcon, self).__init__(driver)
self.locator = self.Locator.xpath_selector(
"//*[@content-desc='chat-menu-button']/../preceding-sibling::*[1]//*[@content-desc='icon']")
self.locator = self.Locator.xpath_selector('(//android.view.ViewGroup[@content-desc="icon"])[2]')
class PolicySummary(BaseElement):