diff --git a/src/quo2/components/community/community_card_view.cljs b/src/quo2/components/community/community_card_view.cljs index a0d57b7b37f..159374959a8 100644 --- a/src/quo2/components/community/community_card_view.cljs +++ b/src/quo2/components/community/community_card_view.cljs @@ -21,10 +21,9 @@ [rn/view (style/community-cover-container 60) [rn/image {:source cover - :style - {:flex 1 - :border-top-right-radius 20 - :border-top-left-radius 20}}]] + :style {:flex 1 + :border-top-right-radius 20 + :border-top-left-radius 20}}]] [rn/view (style/card-view-content-container 12) [rn/view (style/card-view-chat-icon 48) [icon/community-icon {:images images} 48]] diff --git a/src/status_im2/common/scroll_page/view.cljs b/src/status_im2/common/scroll_page/view.cljs index accea411b3c..408a1913955 100644 --- a/src/status_im2/common/scroll_page/view.cljs +++ b/src/status_im2/common/scroll_page/view.cljs @@ -89,7 +89,7 @@ (defn display-picture - [scroll-height cover] + [scroll-height logo] (let [input-range (if platform/ios? [-67 10] [0 150]) y (reanimated/use-shared-value scroll-height) animation (reanimated/interpolate y @@ -104,7 +104,7 @@ [reanimated/view {:style (style/display-picture-container animation)} [rn/image - {:source cover + {:source logo :style style/display-picture}]])) (defn scroll-page @@ -141,6 +141,6 @@ {:flex 1 :border-radius (diff-with-max-min @scroll-height 16 0) :background-color background-color} - (when cover-image - [:f> display-picture @scroll-height cover-image]) + (when logo + [:f> display-picture @scroll-height logo]) children])]}]]))) diff --git a/src/status_im2/contexts/communities/discover/style.cljs b/src/status_im2/contexts/communities/discover/style.cljs index 1adc1bf6354..42ee4b86be5 100644 --- a/src/status_im2/contexts/communities/discover/style.cljs +++ b/src/status_im2/contexts/communities/discover/style.cljs @@ -22,12 +22,12 @@ (def featured-list-container {:flex-direction :row - :overflow :hidden}) + :overflow :hidden + :margin-right 20}) (def flat-list-container - {:padding-bottom 24 - :margin-left 20 - :padding-right 20}) + {:padding-bottom 24 + :padding-horizontal 20}) (def other-communities-container {:flex 1 diff --git a/src/status_im2/contexts/communities/discover/view.cljs b/src/status_im2/contexts/communities/discover/view.cljs index d39e554a1bf..6cc77a57211 100644 --- a/src/status_im2/contexts/communities/discover/view.cljs +++ b/src/status_im2/contexts/communities/discover/view.cljs @@ -7,7 +7,6 @@ [reagent.core :as reagent] [status-im2.common.resources :as resources] [status-im2.contexts.communities.menus.community-options.view :as options] - [status-im.ui.screens.communities.community :as community] [status-im.ui.components.react :as react] [react-native.platform :as platform] [status-im2.common.scroll-page.view :as scroll-page] @@ -26,7 +25,7 @@ [community-item _ _ {:keys [width view-type]}] (let [item (merge community-item (get mock-community-item-data :data)) - cover {:uri (get-in (:images item) [:banner :uri])}] + cover {:uri (get-in (:images community-item) [:banner :uri])}] (if (= view-type :card-view) [quo/community-card-view-item (assoc item :width width :cover cover) #(rf/dispatch [:navigate-to :community-overview (:id item)])] @@ -89,7 +88,6 @@ :label (i18n/label :t/gated) :accessibility-label :gated-communities-tab}]}]]) - (defn featured-list [communities view-type] (let [view-size (reagent/atom 0)] @@ -97,8 +95,8 @@ [rn/view {:style style/featured-list-container :on-layout #(swap! view-size - (fn [] - (- (oops/oget % "nativeEvent.layout.width") 20)))} + (fn [] + (- (oops/oget % "nativeEvent.layout.width") 20)))} (when-not (= @view-size 0) [rn/flat-list {:key-fn :id @@ -127,32 +125,16 @@ (defn other-communities-list [{:keys [communities communities-ids view-type]}] [rn/view {:style style/other-communities-container} - (map-indexed - (fn [inner-index item] - (let [community-id (when communities-ids item) - community (if communities - item - [rf/sub [:communities/home-item community-id]])] - [rn/view - {:key (str inner-index (:id community)) - :margin-bottom 16} - (if (= view-type :card-view) - [quo/community-card-view-item - (merge community - (get mock-community-item-data :data)) - #(rf/dispatch [:navigate-to :community-overview (:id community)])] - [quo/communities-list-view-item - {:on-press (fn [] - (rf/dispatch [:communities/load-category-states (:id community)]) - (rf/dispatch [:dismiss-keyboard]) - (rf/dispatch [:navigate-to :community (:id community)])) - :on-long-press #(rf/dispatch [:bottom-sheet/show-sheet - {:content (fn [] - ;; TODO implement with quo2 - [community/community-actions community])}])} - (merge community - (get mock-community-item-data :data))])])) - (if communities communities communities-ids))]) + [rn/flat-list + {:key-fn :id + :keyboard-should-persist-taps :always + :shows-horizontal-scroll-indicator false + :separator [rn/view {:height 16}] + :data (if communities + communities + communities-ids) + :render-fn community-list-item + :render-data {:view-type view-type}}]]) (defn communities-lists [selected-tab view-type]