Skip to content

Commit 2eccca9

Browse files
flexsurferrasom
authored andcommitted
improved new chat UI
1 parent 0d0c37e commit 2eccca9

3 files changed

Lines changed: 36 additions & 12 deletions

File tree

src/status_im/ui/screens/add_new/new_chat/views.cljs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,27 @@
2424
[react/keyboard-avoiding-view open-dapp.styles/main-container
2525
[status-bar/status-bar]
2626
[toolbar.view/simple-toolbar (i18n/label :t/new-chat)]
27-
[react/view add-new.styles/input-container
28-
[react/text-input {:on-change-text #(re-frame/dispatch [:set :contacts/new-identity %])
29-
:on-submit-editing #(when-not error-message
30-
(re-frame/dispatch [:add-contact-handler]))
31-
:placeholder (i18n/label :t/enter-contact-code)
32-
:style add-new.styles/input
33-
:accessibility-label :enter-contact-code-input
34-
:return-key-type :go}]
27+
[react/view add-new.styles/new-chat-container
28+
[react/view add-new.styles/new-chat-input-container
29+
[react/text-input {:on-change-text #(re-frame/dispatch [:set :contacts/new-identity %])
30+
:on-submit-editing #(when-not error-message
31+
(re-frame/dispatch [:add-contact-handler]))
32+
:placeholder (i18n/label :t/enter-contact-code)
33+
:style add-new.styles/input
34+
:accessibility-label :enter-contact-code-input
35+
:return-key-type :go}]]
3536
[react/touchable-highlight {:on-press #(re-frame/dispatch [:scan-qr-code
3637
{:toolbar-title (i18n/label :t/new-contact)}
3738
:set-contact-identity-from-qr])
38-
:style {:margin-right 14}
39+
:style add-new.styles/button-container
3940
:accessibility-label :scan-contact-code-button}
4041
[react/view
4142
[vector-icons/icon :icons/qr {:color colors/blue}]]]]
4243
[react/text {:style styles/error-message}
4344
error-message]
44-
[react/text {:style open-dapp.styles/list-title}
45-
(i18n/label :t/contacts)]
45+
(when (seq contacts)
46+
[react/text {:style open-dapp.styles/list-title}
47+
(i18n/label :t/contacts)])
4648
[list/flat-list {:data contacts
4749
:key-fn :address
4850
:render-fn render-row

src/status_im/ui/screens/add_new/new_public_chat/styles.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
:color colors/white})
4343

4444
(def input-container
45-
{:padding-left 0
45+
{:padding 0
46+
:padding-right 16
4647
:background-color nil})
4748

4849
(def tooltip

src/status_im/ui/screens/add_new/styles.cljs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
(:require [status-im.ui.components.colors :as colors]
44
[status-im.ui.components.styles :as styles]))
55

6+
(def new-chat-container
7+
{:flex-direction :row
8+
:align-items :center})
9+
610
(def input-container
711
{:flex-direction :row
812
:align-items :center
@@ -12,6 +16,23 @@
1216
:margin-horizontal 14
1317
:margin-top 24})
1418

19+
(def new-chat-input-container
20+
(merge
21+
input-container
22+
{:flex 1
23+
:margin-horizontal 0
24+
:margin-left 14}))
25+
26+
(def button-container
27+
{:justify-content :center
28+
:border-radius styles/border-radius
29+
:height 52
30+
:background-color colors/gray-lighter
31+
:padding-horizontal 15
32+
:margin-right 14
33+
:margin-left 3
34+
:margin-top 24})
35+
1536
(defstyle input
1637
{:flex 1
1738
:font-size 15

0 commit comments

Comments
 (0)