Address field in Send to Contacts Screen (#522)

This commit is contained in:
alwx 2016-12-01 16:07:05 +03:00
parent a53a0f9ffa
commit 749ee16d58
18 changed files with 87 additions and 15 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 951 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "icon_enter_address.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 951 B

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "icon_scan_q_r.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

View File

@ -142,12 +142,13 @@
{:flex 1 {:flex 1
:flexDirection :row :flexDirection :row
:height 56 :height 56
:margin-right 16
:backgroundColor color-white}) :backgroundColor color-white})
(def info-container (def info-container
{:flex 1 {:flex 1
:flexDirection :column :flexDirection :column
:marginLeft 12 :margin-left 12
:justifyContent :center}) :justifyContent :center})
(def name-text (def name-text
@ -185,7 +186,7 @@
(def form-container (def form-container
{:margin-left 16 {:margin-left 16
:margin-top 16 :margin-top 8
:height 72}) :height 72})
(def address-explication-container (def address-explication-container
@ -208,7 +209,16 @@
(def qr-input (def qr-input
{:margin-right 42}) {:margin-right 42})
(def enter-address-icon
{:margin-left 21
:margin-right 21
:margin-top 19
:width 20
:height 18})
(def scan-qr-icon (def scan-qr-icon
{:margin 18 {:margin-left 21
:width 25 :margin-right 20
:height 19}) :margin-top 18
:width 20
:height 20})

View File

@ -9,17 +9,23 @@
[status-im.contacts.views.contact :refer [contact-view [status-im.contacts.views.contact :refer [contact-view
on-press on-press
contact-view-with-letter]] contact-view-with-letter]]
[status-im.components.text-field.view :refer [text-field]]
[status-im.components.status-bar :refer [status-bar]] [status-im.components.status-bar :refer [status-bar]]
[status-im.components.toolbar.view :refer [toolbar]] [status-im.components.toolbar.view :refer [toolbar]]
[status-im.components.toolbar.styles :refer [toolbar-background1]] [status-im.components.toolbar.styles :refer [toolbar-background1]]
[status-im.components.drawer.view :refer [drawer-view open-drawer]] [status-im.components.drawer.view :refer [drawer-view open-drawer]]
[status-im.components.styles :refer [icon-search [status-im.components.styles :refer [icon-search
icon-back]] icon-back
button-input-container
button-input]]
[status-im.components.image-button.view :refer [scan-button]]
[status-im.contacts.styles :as st] [status-im.contacts.styles :as st]
[status-im.utils.listview :as lw] [status-im.utils.listview :as lw]
[status-im.i18n :refer [label]] [status-im.i18n :refer [label]]
[status-im.utils.platform :refer [platform-specific]] [status-im.utils.platform :refer [platform-specific]]
[status-im.contacts.views.contact-inner :refer [contact-inner-view]])) [status-im.contacts.views.contact-inner :refer [contact-inner-view]]
[reagent.core :as r]
[clojure.string :as str]))
(defn new-group-chat-view [] (defn new-group-chat-view []
[touchable-highlight [touchable-highlight
@ -42,19 +48,17 @@
(or click-handler (or click-handler
(on-press row))])))) (on-press row))]))))
(defn qr-scan [click-handler action] (defn contact-list-entry [{:keys [click-handler icon icon-style label]}]
[touchable-highlight [touchable-highlight
{:onPress #(click-handler :qr-scan action)} {:on-press click-handler}
[view st/contact-container [view st/contact-container
[view st/contact-inner-container [view st/contact-inner-container
[image {:source {:uri :icon_menu_group} [image {:source {:uri icon}
:style st/scan-qr-icon}] :style icon-style}]
[view st/info-container [view st/info-container
[text {:style st/name-text [text {:style st/name-text
:number-of-lines 1} :number-of-lines 1}
(label (if (= :request action) label]]]]])
:t/show-qr
:t/scan-qr))]]]]])
(defview contact-list-toolbar [] (defview contact-list-toolbar []
[group [:get :contacts-group] [group [:get :contacts-group]
@ -90,11 +94,25 @@
[contact-list-toolbar] [contact-list-toolbar]
;; todo add stub ;; todo add stub
(when modal (when modal
[qr-scan click-handler action]) [view
[contact-list-entry {:click-handler #(do
(dispatch [:send-to-webview-bridge
{:event (name :webview-send-transaction)}])
(dispatch [:navigate-back]))
:icon :icon_enter_address
:icon-style st/enter-address-icon
:label (label :t/enter-address)}]
[contact-list-entry {:click-handler #(click-handler :qr-scan action)
:icon :icon_scan_q_r
:icon-style st/scan-qr-icon
:label (label (if (= :request action)
:t/show-qr
:t/scan-qr))}]])
(when contacts (when contacts
[list-view {:dataSource (lw/to-datasource contacts) [list-view {:dataSource (lw/to-datasource contacts)
:enableEmptySections true :enableEmptySections true
:renderRow (render-row modal click-handler action params) :renderRow (render-row modal click-handler action params)
:bounces false
:renderHeader #(list-item :renderHeader #(list-item
[view [view
(if show-new-group-chat? (if show-new-group-chat?

View File

@ -127,6 +127,7 @@
:contacts-group-new-chat "Start new chat" :contacts-group-new-chat "Start new chat"
:no-contacts "No contacts yet" :no-contacts "No contacts yet"
:show-qr "Show QR" :show-qr "Show QR"
:enter-address "Enter address"
;group-settings ;group-settings
:remove "Remove" :remove "Remove"

View File

@ -125,6 +125,7 @@
:contacts-group-new-chat "Начать новый час" :contacts-group-new-chat "Начать новый час"
:no-contacts "Пока нет контактов" :no-contacts "Пока нет контактов"
:show-qr "Показать QR" :show-qr "Показать QR"
:enter-address "Ввести адрес"
;group-settings ;group-settings
:remove "Удалить" :remove "Удалить"