Skip to content

Commit

Permalink
Fit flat list into container
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferossgp committed Apr 9, 2020
1 parent e46c2de commit 2e02743
Showing 1 changed file with 47 additions and 44 deletions.
91 changes: 47 additions & 44 deletions src/status_im/ui/screens/group/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -113,50 +113,53 @@
group-name [:new-chat-name]]
(let [save-btn-enabled? (and (spec/valid? :global/not-empty-string group-name) (pos? (count contacts)))]
[kb-presentation/keyboard-avoiding-view {:style styles/group-container}
[toolbar/toolbar {}
toolbar/default-nav-back
[react/view {:style styles/toolbar-header-container}
[react/view
[react/text (i18n/label :t/new-group-chat)]]
[react/view
[react/text {:style (styles/toolbar-sub-header)}
(i18n/label :t/group-chat-members-count
{:selected (inc (count contacts))
:max constants/max-group-chat-participants})]]]]
[react/view {:style {:padding-vertical 16
:flex 1}}
[react/view {:style {:padding-horizontal 16}}
[react/view (add-new.styles/input-container)
[react/text-input
{:auto-focus true
:on-change-text #(re-frame/dispatch [:set :new-chat-name %])
:default-value group-name
:placeholder (i18n/label :t/set-a-topic)
:style add-new.styles/input
:accessibility-label :chat-name-input}]]
[react/text {:style (styles/members-title)}
(i18n/label :t/members-title)]]
[react/view {:style {:margin-top 8}}
[list/flat-list {:data contacts
:key-fn :address
:render-fn render-contact
:bounces false
:keyboard-should-persist-taps :always
:enable-empty-sections true}]]]
[bottom-toolbar/toolbar
{:show-border? true
:left {:type :previous
:accessibility-label :previous-button
:label (i18n/label :t/back)
:on-press #(re-frame/dispatch [:navigate-back])}
:right {:type :secondary
:container-style {:padding-horizontal 16}
:text-style {:font-weight "500"}
:accessibility-label :create-group-chat-button
:label (i18n/label :t/create-group-chat)
:disabled? (not save-btn-enabled?)
:on-press #(debounce/dispatch-and-chill [:group-chats.ui/create-pressed group-name]
300)}}]])))
[react/view {:flex 1}
[toolbar/toolbar {}
toolbar/default-nav-back
[react/view {:style styles/toolbar-header-container}
[react/view
[react/text (i18n/label :t/new-group-chat)]]
[react/view
[react/text {:style (styles/toolbar-sub-header)}
(i18n/label :t/group-chat-members-count
{:selected (inc (count contacts))
:max constants/max-group-chat-participants})]]]]

[react/view {:style {:padding-top 16
:flex 1}}
[react/view {:style {:padding-horizontal 16}}
[react/view (add-new.styles/input-container)
[react/text-input
{:auto-focus true
:on-change-text #(re-frame/dispatch [:set :new-chat-name %])
:default-value group-name
:placeholder (i18n/label :t/set-a-topic)
:style add-new.styles/input
:accessibility-label :chat-name-input}]]
[react/text {:style (styles/members-title)}
(i18n/label :t/members-title)]]
[react/view {:style {:margin-top 8
:flex 1}}
[list/flat-list {:data contacts
:key-fn :address
:render-fn render-contact
:bounces false
:keyboard-should-persist-taps :always
:enable-empty-sections true}]]]
[bottom-toolbar/toolbar
{:show-border? true
:left {:type :previous
:accessibility-label :previous-button
:label (i18n/label :t/back)
:on-press #(re-frame/dispatch [:navigate-back])}
:right {:type :secondary
:container-style {:padding-horizontal 16}
:text-style {:font-weight "500"}
:accessibility-label :create-group-chat-button
:label (i18n/label :t/create-group-chat)
:disabled? (not save-btn-enabled?)
:on-press #(debounce/dispatch-and-chill [:group-chats.ui/create-pressed group-name]
300)}}]]])))

(defn searchable-contact-list []
(let [search-value (reagent/atom nil)]
Expand Down

0 comments on commit 2e02743

Please sign in to comment.