From c99af08c4fd961ca47f0d34e8fc88468f17b0b75 Mon Sep 17 00:00:00 2001 From: Eric Dvorsak Date: Tue, 9 Jan 2018 12:11:08 +0100 Subject: [PATCH] [fix #2903] fix arity bug on iOS also use ListEmptyComponent prop for section-list --- src/status_im/ui/components/list/views.cljs | 23 +++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/status_im/ui/components/list/views.cljs b/src/status_im/ui/components/list/views.cljs index 9ab20e6121..5f59c9524d 100644 --- a/src/status_im/ui/components/list/views.cljs +++ b/src/status_im/ui/components/list/views.cljs @@ -5,8 +5,8 @@ (defn render [{:keys [title subtitle]}] [item [item-icon {:icon :dots_vertical_white}] - [item-content - [item-primary title] + [item-content + [item-primary title] [item-secondary subtitle]] [item-icon {:icon :arrow_right_gray}]]) @@ -125,7 +125,7 @@ (defn flat-list "A wrapper for FlatList. See https://facebook.github.io/react-native/docs/flatlist.html" - [{:keys [data empty-component] :as props}] + [{:keys [data] :as props}] {:pre [(or (nil? data) (sequential? data))]} [flat-list-class @@ -152,14 +152,11 @@ (defn section-list "A wrapper for SectionList. See https://facebook.github.io/react-native/docs/sectionlist.html" - [{:keys [sections empty-component render-section-header-fn] :as props + [{:keys [sections render-section-header-fn] :as props :or {render-section-header-fn default-render-section-header}}] - (if (and (every? #(empty? (:data %)) sections) empty-component) - empty-component - [section-list-class - (merge (base-list-props props) - props - {:sections (clj->js (map wrap-per-section-render-fn sections)) - :renderSectionHeader (wrap-render-section-header-fn render-section-header-fn)} - (when platform/ios? {:SectionSeparatorComponent (fn [] (reagent/as-element [section-separator]))}))])) - + [section-list-class + (merge (base-list-props props) + props + {:sections (clj->js (map wrap-per-section-render-fn sections)) + :renderSectionHeader (wrap-render-section-header-fn render-section-header-fn)} + (when platform/ios? {:SectionSeparatorComponent (fn [] (reagent/as-element section-separator))}))])