Merge pull request #531 from status-im/feature/#522

Address field in Send to Contacts Screen (#522)
This commit is contained in:
Roman Volosovskyi 2016-12-02 11:55:15 +02:00 committed by GitHub
commit d25ac5e0fe
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
:flexDirection :row
:height 56
:margin-right 16
:backgroundColor color-white})
(def info-container
{:flex 1
:flexDirection :column
:marginLeft 12
:margin-left 12
:justifyContent :center})
(def name-text
@ -185,7 +186,7 @@
(def form-container
{:margin-left 16
:margin-top 16
:margin-top 8
:height 72})
(def address-explication-container
@ -208,7 +209,16 @@
(def qr-input
{:margin-right 42})
(def enter-address-icon
{:margin-left 21
:margin-right 21
:margin-top 19
:width 20
:height 18})
(def scan-qr-icon
{:margin 18
:width 25
:height 19})
{:margin-left 21
:margin-right 20
:margin-top 18
:width 20
:height 20})

View File

@ -9,17 +9,23 @@
[status-im.contacts.views.contact :refer [contact-view
on-press
contact-view-with-letter]]
[status-im.components.text-field.view :refer [text-field]]
[status-im.components.status-bar :refer [status-bar]]
[status-im.components.toolbar.view :refer [toolbar]]
[status-im.components.toolbar.styles :refer [toolbar-background1]]
[status-im.components.drawer.view :refer [drawer-view open-drawer]]
[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.utils.listview :as lw]
[status-im.i18n :refer [label]]
[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 []
[touchable-highlight
@ -42,19 +48,17 @@
(or click-handler
(on-press row))]))))
(defn qr-scan [click-handler action]
(defn contact-list-entry [{:keys [click-handler icon icon-style label]}]
[touchable-highlight
{:onPress #(click-handler :qr-scan action)}
{:on-press click-handler}
[view st/contact-container
[view st/contact-inner-container
[image {:source {:uri :icon_menu_group}
:style st/scan-qr-icon}]
[image {:source {:uri icon}
:style icon-style}]
[view st/info-container
[text {:style st/name-text
:number-of-lines 1}
(label (if (= :request action)
:t/show-qr
:t/scan-qr))]]]]])
label]]]]])
(defview contact-list-toolbar []
[group [:get :contacts-group]
@ -90,11 +94,25 @@
[contact-list-toolbar]
;; todo add stub
(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
[list-view {:dataSource (lw/to-datasource contacts)
:enableEmptySections true
:renderRow (render-row modal click-handler action params)
:bounces false
:renderHeader #(list-item
[view
(if show-new-group-chat?

View File

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

View File

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