applied new design

Former-commit-id: 9f405ee18d
This commit is contained in:
Adrian Tiberius 2016-06-21 17:15:46 +03:00
parent da49076648
commit a9d2ed2711
22 changed files with 87 additions and 32 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

View File

@ -63,6 +63,10 @@
{:width 23 {:width 23
:height 22}) :height 22})
(def icon-scan
{:width 18
:height 18})
(def icon-plus (def icon-plus
{:width 18 {:width 18
:height 18}) :height 18})
@ -92,10 +96,8 @@
(def button-input-container (def button-input-container
{:flex 1 {:flex 1
:flexDirection :row :flexDirection :row})
:height 50})
(def button-input (def button-input
{:flex 1 {:flex 1
:flexDirection :column :flexDirection :column})
:height 50})

View File

@ -71,7 +71,8 @@
(def contact-form-container (def contact-form-container
{:flex 1 {:flex 1
:color :white}) :color :white
:backgroundColor :white})
(def gradient-background (def gradient-background
{:position :absolute {:position :absolute
@ -82,4 +83,13 @@
(def form-container (def form-container
{:marginLeft 16 {:marginLeft 16
:margin-top 50}) :margin-top 16})
(def address-explication-container
{:flex 1
:paddingLeft 16
:paddingRight 16})
(def address-explication
{:textAlign :center
:color "#838c93de"})

View File

@ -19,8 +19,8 @@
toolbar-title-text toolbar-title-text
button-input-container button-input-container
button-input button-input
white-form-text-input]] form-text-input]]
[status-im.qr-scanner.views.import-button :refer [import-button]] [status-im.qr-scanner.views.scan-button :refer [scan-button]]
[status-im.i18n :refer [label]] [status-im.i18n :refer [label]]
[status-im.contacts.styles :as st])) [status-im.contacts.styles :as st]))
@ -28,51 +28,46 @@
(def toolbar-title (def toolbar-title
[view toolbar-title-container [view toolbar-title-container
[text {:style (merge toolbar-title-text {:color color-white})} [text {:style toolbar-title-text}
(label :t/new-contact)]]) (label :t/add-new-contact)]])
(defview contact-name-input [name] (defview contact-name-input [name]
[] []
[text-input [text-input
{:underlineColorAndroid color-white {:underlineColorAndroid "#0000001f"
:placeholderTextColor color-white :placeholderTextColor "#838c93de"
:style white-form-text-input :style form-text-input
:autoFocus true :autoFocus true
:placeholder (label :t/contact-name) :placeholder (label :t/name)
:onChangeText #(dispatch [:set-in [:new-contact :name] %])} :onChangeText #(dispatch [:set-in [:new-contact :name] %])}
name]) name])
(defview contact-whisper-id-input [whisper-identity] (defview contact-whisper-id-input [whisper-identity]
[view button-input-container [view button-input-container
[text-input [text-input
{:underlineColorAndroid color-white {:underlineColorAndroid "#0000001f"
:placeholderTextColor color-white :placeholderTextColor "#838c93de"
:style (merge white-form-text-input button-input) :style (merge form-text-input button-input)
:autoFocus true :autoFocus true
:placeholder (label :t/whisper-identity) :placeholder (label :t/address)
:onChangeText #(dispatch [:set-in [:new-contact :whisper-identity] %])} :onChangeText #(dispatch [:set-in [:new-contact :whisper-identity] %])}
whisper-identity] whisper-identity]
[import-button #(dispatch [:scan-qr-code {:toolbar-title (label :t/new-contact)} :set-new-contact-from-qr])]]) [scan-button #(dispatch [:scan-qr-code {:toolbar-title (label :t/new-contact)} :set-new-contact-from-qr])]])
(defview new-contact [] (defview new-contact []
[{:keys [name whisper-identity phone-number] :as new-contact} [:get :new-contact]] [{:keys [name whisper-identity phone-number] :as new-contact} [:get :new-contact]]
[drawer-view [drawer-view
[view st/contact-form-container [view st/contact-form-container
[linear-gradient {:colors ["rgba(182, 116, 241, 1)" "rgba(107, 147, 231, 1)" "rgba(43, 171, 238, 1)"] [toolbar {:background-color :white
:start [0, 0] :nav-action {:image {:source {:uri :icon_back}
:end [0.5, 1]
:locations [0, 0.8 ,1]
:style st/gradient-background}]
[toolbar {:background-color :transparent
:nav-action {:image {:source {:uri :icon_back_white}
:style icon-back} :style icon-back}
:handler #(dispatch [:navigate-back])} :handler #(dispatch [:navigate-back])}
:custom-content toolbar-title :custom-content toolbar-title
:action {:image {:source {:uri :icon_add} :action {:image {:source {:uri :icon_ok_blue}
:style icon-search} :style icon-search}
:handler #(dispatch [:add-new-contact new-contact])}}] :handler #(dispatch [:add-new-contact new-contact])}}]
[view st/form-container [view st/form-container
[contact-whisper-id-input whisper-identity]
[contact-name-input name] [contact-name-input name]
]]]) [contact-whisper-id-input whisper-identity]]
[view st/address-explication-container
[text {:style st/address-explication} (label :t/address-explication)]]]])

View File

@ -74,3 +74,25 @@
:flexDirection :column :flexDirection :column
:color color-white :color color-white
:margin-left 8}) :margin-left 8})
(def scan-button
{:position :absolute
:top 5
:right 16
:flex 1
:height 50
:alignItems :center})
(def scan-button-content
{:flex 1
:flexDirection :row
:height 50
:alignItems :center
:alignSelf :center})
(def scan-text
{:flex 1
:flexDirection :column
:color "#7099e6"
:margin-left 8})

View File

@ -0,0 +1,23 @@
(ns status-im.qr-scanner.views.scan-button
(:require-macros [status-im.utils.views :refer [defview]])
(:require [re-frame.core :refer [subscribe dispatch dispatch-sync]]
[status-im.components.react :refer [view
text
image
touchable-highlight]]
[status-im.components.toolbar :refer [toolbar]]
[status-im.components.drawer.view :refer [drawer-view open-drawer]]
[status-im.components.styles :refer [icon-scan]]
[status-im.i18n :refer [label]]
[status-im.qr-scanner.styles :as st]))
(defview scan-button [handler]
[]
[view st/scan-button
[touchable-highlight
{:on-press handler}
[view st/scan-button-content
[image {:source {:uri :scan_blue}
:style icon-scan}]
[text {:style st/scan-text} (label :t/scan-qr)]]]])

View File

@ -115,9 +115,12 @@
:You "You" :You "You"
;new-contact ;new-contact
:add-new-contact "Add new contact"
:import-qr "Import" :import-qr "Import"
:contact-name "Contact Name" :scan-qr "Scan QR"
:name "Name"
:whisper-identity "Whisper Identity" :whisper-identity "Whisper Identity"
:address-explication "Maybe here should be some text explaining what an address is and where to look for it"
;login ;login
:recover-from-passphrase "Recover from passphrase" :recover-from-passphrase "Recover from passphrase"
@ -127,6 +130,6 @@
:login "Login" :login "Login"
;users ;users
:add-account "Add account" :add-account "Add account"
}) })