Merge pull request #357 from status-im/bug/#350
Status styles in profile and drawer (#350)
Former-commit-id: eb50cdd83e
This commit is contained in:
commit
3ea54eac5a
|
@ -111,9 +111,9 @@
|
|||
(def online-dot-right (merge online-dot {:left 10}))
|
||||
|
||||
(def photo-pencil
|
||||
{:margin-left 5
|
||||
:margin-right 5
|
||||
:margin-top 3
|
||||
{:margin-left 8
|
||||
:margin-right 2
|
||||
:margin-top 6
|
||||
:font-size 12
|
||||
:color :white})
|
||||
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
text1-color
|
||||
text2-color
|
||||
text3-color
|
||||
color-red]]))
|
||||
color-red]]
|
||||
[status-im.utils.platform :as p]))
|
||||
|
||||
(def drawer-menu
|
||||
{:flex 1
|
||||
|
@ -28,10 +29,10 @@
|
|||
:height 64})
|
||||
|
||||
(def name-container
|
||||
{:margin-top -16
|
||||
{:margin-top (if p/ios? -13 -19)
|
||||
:margin-bottom -16
|
||||
:margin-left 16
|
||||
:margin-right 16})
|
||||
:margin-left 16
|
||||
:margin-right 16})
|
||||
|
||||
(def name-input-wrapper
|
||||
{})
|
||||
|
@ -44,7 +45,7 @@
|
|||
(def status-container
|
||||
{:margin-left 16
|
||||
:margin-right 16
|
||||
:margin-top 4
|
||||
:margin-top (if p/ios? 5 5)
|
||||
:align-items :center})
|
||||
|
||||
(def status-input
|
||||
|
@ -52,7 +53,6 @@
|
|||
:height 56
|
||||
:font-size 14
|
||||
:padding-left 4
|
||||
:line-height 20
|
||||
:text-align :center
|
||||
:text-align-vertical :top
|
||||
:color text2-color})
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
(map get-text)))
|
||||
|
||||
(defn status-image-view [{{:keys [name status photo-path]} :account
|
||||
edit? :edit?}]
|
||||
edit? :edit?}]
|
||||
[view st/status-block
|
||||
[view st/user-photo-container
|
||||
(if edit?
|
||||
|
@ -90,14 +90,13 @@
|
|||
:wrapper-style st/username-wrapper
|
||||
:value name
|
||||
:on-change-text #(dispatch [:set-in [:profile-edit :name] %])}]
|
||||
(if edit?
|
||||
[text-input {:style st/status-input
|
||||
:maxLength 140
|
||||
:editable edit?
|
||||
:placeholder (label :t/profile-no-status)
|
||||
:on-change-text #(dispatch [:set-in [:profile-edit :status] %])
|
||||
:default-value status}]
|
||||
[text {:style st/status-text} (highlight-tags status)])])
|
||||
[text-input {:style st/status-input
|
||||
:maxLength 140
|
||||
:multiline true
|
||||
:editable edit?
|
||||
:placeholder (label :t/profile-no-status)
|
||||
:on-change-text #(dispatch [:set-in [:profile-edit :status] %])
|
||||
:default-value status}]])
|
||||
|
||||
(defview profile []
|
||||
[{whisper-identity :whisper-identity
|
||||
|
@ -163,42 +162,42 @@
|
|||
[view [text {:style st/report-user-text} (label :t/report-user)]]]]]])
|
||||
|
||||
(defview my-profile []
|
||||
[edit? [:get-in [:profile-edit :edit?]]
|
||||
[edit? [:get-in [:profile-edit :edit?]]
|
||||
current-account [:get-current-account]
|
||||
changed-account [:get :profile-edit]]
|
||||
(let [{:keys [phone
|
||||
address
|
||||
public-key] :as account} (if edit?
|
||||
changed-account
|
||||
current-account)]
|
||||
[scroll-view {:style st/profile
|
||||
:keyboardShouldPersistTaps true}
|
||||
[status-bar]
|
||||
[toolbar {:account account
|
||||
:edit? edit?}]
|
||||
(let [{:keys [phone
|
||||
address
|
||||
public-key] :as account} (if edit?
|
||||
changed-account
|
||||
current-account)]
|
||||
[scroll-view {:style st/profile
|
||||
:keyboardShouldPersistTaps true}
|
||||
[status-bar]
|
||||
[toolbar {:account account
|
||||
:edit? edit?}]
|
||||
|
||||
[status-image-view {:account account
|
||||
:edit? edit?}]
|
||||
[status-image-view {:account account
|
||||
:edit? edit?}]
|
||||
|
||||
[scroll-view (merge st/profile-properties-container {:keyboardShouldPersistTaps true})
|
||||
[view st/profile-property
|
||||
[selectable-field {:label (label :t/phone-number)
|
||||
:value (if (and phone (not (str/blank? phone)))
|
||||
(format-phone-number phone)
|
||||
(label :t/not-specified))}]
|
||||
[view st/underline-container]]
|
||||
[scroll-view (merge st/profile-properties-container {:keyboardShouldPersistTaps true})
|
||||
[view st/profile-property
|
||||
[selectable-field {:label (label :t/phone-number)
|
||||
:value (if (and phone (not (str/blank? phone)))
|
||||
(format-phone-number phone)
|
||||
(label :t/not-specified))}]
|
||||
[view st/underline-container]]
|
||||
|
||||
[view st/profile-property
|
||||
[selectable-field {:label (label :t/address)
|
||||
:value address}]
|
||||
[view st/underline-container]]
|
||||
[view st/profile-property
|
||||
[selectable-field {:label (label :t/address)
|
||||
:value address}]
|
||||
[view st/underline-container]]
|
||||
|
||||
[view st/profile-property
|
||||
[selectable-field {:label (label :t/public-key)
|
||||
:value public-key}]]
|
||||
[view st/profile-property
|
||||
[selectable-field {:label (label :t/public-key)
|
||||
:value public-key}]]
|
||||
|
||||
[view st/underline-container]
|
||||
[view st/underline-container]
|
||||
|
||||
[view st/qr-code-container
|
||||
[qr-code {:value (str "ethereum:" public-key)
|
||||
:size 220}]]]]))
|
||||
[view st/qr-code-container
|
||||
[qr-code {:value (str "ethereum:" public-key)
|
||||
:size 220}]]]]))
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
text1-color
|
||||
text1-disabled-color
|
||||
text2-color
|
||||
color-red]]))
|
||||
color-red]]
|
||||
[status-im.utils.platform :as p]))
|
||||
|
||||
(def profile
|
||||
{:flex 1
|
||||
|
@ -54,7 +55,7 @@
|
|||
|
||||
(def username-wrapper
|
||||
{:width 300
|
||||
:margin-top -22
|
||||
:margin-top (if p/ios? -18 -22)
|
||||
:margin-bottom -16})
|
||||
|
||||
(defn username-input [edit? valid?]
|
||||
|
@ -76,20 +77,12 @@
|
|||
{:align-self "stretch"
|
||||
:margin-left 16
|
||||
:margin-right 16
|
||||
:height 40
|
||||
:margin-top 0
|
||||
:margin-top (if p/ios? 6 1)
|
||||
:font-size 14
|
||||
:line-height 20
|
||||
:min-height 60
|
||||
:text-align :center
|
||||
:color text2-color})
|
||||
|
||||
(def status-text
|
||||
{:text-align :center
|
||||
:margin-left 0
|
||||
:margin-right 0
|
||||
:margin-top 10
|
||||
:color text2-color})
|
||||
|
||||
(def btns-container
|
||||
{:margin-top 18
|
||||
:flex-direction :row})
|
||||
|
|
Loading…
Reference in New Issue