fix #1117
This commit is contained in:
parent
b5edab5a21
commit
0359c2819b
|
@ -5,6 +5,7 @@
|
|||
[status-im.components.common.common :as common]
|
||||
[status-im.components.sticky-button :as sticky-button]
|
||||
[status-im.components.status-bar :as status-bar]
|
||||
[status-im.components.sync-state.offline :as offline-view]
|
||||
[status-im.components.toolbar-new.actions :as act]
|
||||
[status-im.components.toolbar-new.view :as toolbar]
|
||||
[status-im.i18n :as i18n]
|
||||
|
@ -51,22 +52,28 @@
|
|||
(defview transaction-details []
|
||||
[{:keys [id] :as transaction} [:get :selected-transaction]
|
||||
{:keys [password]} [:get :confirm-transactions]
|
||||
confirmed? [:get-in [:transaction-details-ui-props :confirmed?]]]
|
||||
{:component-did-update #(when-not transaction (rf/dispatch [:navigate-to-modal :unsigned-transactions]))
|
||||
confirmed? [:get-in [:transaction-details-ui-props :confirmed?]]
|
||||
sync-state [:get :sync-state]
|
||||
network-status [:get :network-status]]
|
||||
{:component-did-update #(when-not transaction (rf/dispatch [:navigate-to-modal :unsigned-transactions]))
|
||||
:component-will-unmount #(rf/dispatch [:set-in [:transaction-details-ui-props :confirmed?] false])}
|
||||
[rn/keyboard-avoiding-view {:style st/transactions-screen}
|
||||
[status-bar/status-bar {:type :transaction}]
|
||||
[toolbar-view]
|
||||
[rn/scroll-view st/details-screen-content-container
|
||||
[transactions-list-item/view transaction #(rf/dispatch [:navigate-to-modal :unsigned-transactions])]
|
||||
[common/separator st/details-separator st/details-separator-wrapper]
|
||||
[details transaction]]
|
||||
(when confirmed? [password-form/view 1])
|
||||
(let [confirm-text (if confirmed?
|
||||
(i18n/label :t/confirm)
|
||||
(i18n/label-pluralize 1 :t/confirm-transactions))
|
||||
confirm-fn (if confirmed?
|
||||
#(do (rf/dispatch [:accept-transaction password id])
|
||||
(rf/dispatch [:set :confirmed-transactions-count 1]))
|
||||
#(rf/dispatch [:set-in [:transaction-details-ui-props :confirmed?] true]))]
|
||||
[sticky-button/sticky-button confirm-text confirm-fn])])
|
||||
(let [offline? (or (= network-status :offline) (= sync-state :offline))]
|
||||
[rn/keyboard-avoiding-view {:style st/transactions-screen}
|
||||
[status-bar/status-bar {:type :transaction}]
|
||||
[toolbar-view]
|
||||
[rn/scroll-view st/details-screen-content-container
|
||||
[transactions-list-item/view transaction #(rf/dispatch [:navigate-to-modal :unsigned-transactions])]
|
||||
[common/separator st/details-separator st/details-separator-wrapper]
|
||||
[details transaction]]
|
||||
(when (and confirmed? (not offline?))
|
||||
[password-form/view 1])
|
||||
(when-not offline?
|
||||
(let [confirm-text (if confirmed?
|
||||
(i18n/label :t/confirm)
|
||||
(i18n/label-pluralize 1 :t/confirm-transactions))
|
||||
confirm-fn (if confirmed?
|
||||
#(do (rf/dispatch [:accept-transaction password id])
|
||||
(rf/dispatch [:set :confirmed-transactions-count 1]))
|
||||
#(rf/dispatch [:set-in [:transaction-details-ui-props :confirmed?] true]))]
|
||||
[sticky-button/sticky-button confirm-text confirm-fn]))
|
||||
[offline-view/offline-view {:top (if platform/ios? 21 0)}]]))
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
[status-im.components.react :as rn]
|
||||
[status-im.components.sticky-button :as sticky-button]
|
||||
[status-im.components.status-bar :as status-bar]
|
||||
[status-im.components.sync-state.offline :as offline-view]
|
||||
[status-im.components.toolbar-new.actions :as act]
|
||||
[status-im.components.toolbar-new.view :as toolbar]
|
||||
[status-im.transactions.views.list-item :as transactions-list-item]
|
||||
|
@ -41,26 +42,31 @@
|
|||
[transactions-list-item/view row]]]))
|
||||
|
||||
(defview unsigned-transactions []
|
||||
[transactions [:transactions]
|
||||
[transactions [:transactions]
|
||||
{:keys [password]} [:get :confirm-transactions]
|
||||
confirmed? [:get-in [:transactions-list-ui-props :confirmed?]]]
|
||||
{:component-did-update #(when-not (seq transactions) (rf/dispatch [:navigate-back]))
|
||||
confirmed? [:get-in [:transactions-list-ui-props :confirmed?]]
|
||||
sync-state [:get :sync-state]
|
||||
network-status [:get :network-status]]
|
||||
{:component-did-update #(when-not (seq transactions) (rf/dispatch [:navigate-back]))
|
||||
:component-will-unmount #(rf/dispatch [:set-in [:transactions-list-ui-props :confirmed?] false])}
|
||||
[(if platform/ios? rn/keyboard-avoiding-view rn/view) (merge {:behavior :padding} st/transactions-screen)
|
||||
[status-bar/status-bar {:type :transaction}]
|
||||
[toolbar-view transactions]
|
||||
[rn/view {:style st/transactions-screen-content-container}
|
||||
[rn/list-view {:style st/transactions-list
|
||||
:dataSource (lw/to-datasource transactions)
|
||||
:renderSeparator (render-separator-fn (count transactions))
|
||||
:renderRow render-row-fn}]
|
||||
(when confirmed?
|
||||
[password-form/view (count transactions)])]
|
||||
(let [confirm-text (if confirmed?
|
||||
(i18n/label :t/confirm)
|
||||
(i18n/label-pluralize (count transactions) :t/confirm-transactions))
|
||||
confirm-fn (if confirmed?
|
||||
#(do (rf/dispatch [:accept-transactions password])
|
||||
(rf/dispatch [:set :confirmed-transactions-count (count transactions)]))
|
||||
#(rf/dispatch [:set-in [:transactions-list-ui-props :confirmed?] true]))]
|
||||
[sticky-button/sticky-button confirm-text confirm-fn])])
|
||||
(let [offline? (or (= network-status :offline) (= sync-state :offline))]
|
||||
[(if platform/ios? rn/keyboard-avoiding-view rn/view) (merge {:behavior :padding} st/transactions-screen)
|
||||
[status-bar/status-bar {:type :transaction}]
|
||||
[toolbar-view transactions]
|
||||
[rn/view {:style st/transactions-screen-content-container}
|
||||
[rn/list-view {:style st/transactions-list
|
||||
:dataSource (lw/to-datasource transactions)
|
||||
:renderSeparator (render-separator-fn (count transactions))
|
||||
:renderRow render-row-fn}]
|
||||
(when (and confirmed? (not offline?))
|
||||
[password-form/view (count transactions)])]
|
||||
(when-not offline?
|
||||
(let [confirm-text (if confirmed?
|
||||
(i18n/label :t/confirm)
|
||||
(i18n/label-pluralize (count transactions) :t/confirm-transactions))
|
||||
confirm-fn (if confirmed?
|
||||
#(do (rf/dispatch [:accept-transactions password])
|
||||
(rf/dispatch [:set :confirmed-transactions-count (count transactions)]))
|
||||
#(rf/dispatch [:set-in [:transactions-list-ui-props :confirmed?] true]))]
|
||||
[sticky-button/sticky-button confirm-text confirm-fn]))
|
||||
[offline-view/offline-view {:top (if platform/ios? 21 0)}]]))
|
||||
|
|
Loading…
Reference in New Issue