From 2e027435d94812e2fcf317d4b8a7ca3889c293c9 Mon Sep 17 00:00:00 2001 From: Gheorghe Pinzaru Date: Wed, 8 Apr 2020 13:28:05 +0300 Subject: [PATCH] Fit flat list into container --- src/status_im/ui/screens/group/views.cljs | 91 ++++++++++++----------- 1 file changed, 47 insertions(+), 44 deletions(-) diff --git a/src/status_im/ui/screens/group/views.cljs b/src/status_im/ui/screens/group/views.cljs index 1f054fdfa0ca..2c12462d1cf1 100644 --- a/src/status_im/ui/screens/group/views.cljs +++ b/src/status_im/ui/screens/group/views.cljs @@ -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)]