chore: get community img from real data (#14765)

This commit is contained in:
Jamie Caprani 2023-01-23 11:17:50 +00:00 committed by GitHub
parent 92a180c477
commit 098821d20b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 37 deletions

View File

@ -1,8 +1,7 @@
(ns status-im2.contexts.communities.menus.leave.style) (ns status-im2.contexts.communities.menus.leave.style)
(def button-container (def button-container
{:margin-top 16 {:margin-top 20
:margin-bottom 16
:flex 1 :flex 1
:flex-direction :row :flex-direction :row
:align-items :center :align-items :center
@ -17,13 +16,13 @@
(def text {:margin-top 16}) (def text {:margin-top 16})
(def container (def container
{:height 160 {:height 180
:margin-left 20 :margin-left 20
:margin-right 20 :margin-right 20
:margin-bottom 20}) :margin-bottom 20})
(def inner-container (def inner-container
{:flex 1 {:display :flex
:flex-direction :row :flex-direction :row
:align-items :center :align-items :center
:justify-content :space-between}) :justify-content :space-between})

View File

@ -12,6 +12,7 @@
(defn leave-sheet (defn leave-sheet
[id] [id]
(let [{:keys [name images]} (rf/sub [:communities/community id])]
[rn/view {:style style/container} [rn/view {:style style/container}
[rn/view {:style style/inner-container} [rn/view {:style style/inner-container}
[quo/text [quo/text
@ -19,12 +20,11 @@
:weight :semi-bold :weight :semi-bold
:size :heading-1} :size :heading-1}
(i18n/label :t/leave-community?)]] (i18n/label :t/leave-community?)]]
;; TODO get tag image from community data - https://github.com/status-im/status-mobile/issues/14740 [quo/context-tag
#_[quo/context-tag
{:style {:style
{:margin-right :auto {:margin-right :auto
:margin-top 8}} :margin-top 8}}
(resources/get-image :status-logo) (:name community)] (:thumbnail images) name]
[quo/text [quo/text
{:accessibility-label :communities-join-community {:accessibility-label :communities-join-community
:size :paragraph-1 :size :paragraph-1
@ -40,4 +40,4 @@
[quo/button [quo/button
{:on-press #(hide-sheet-and-dispatch [:communities/leave id]) {:on-press #(hide-sheet-and-dispatch [:communities/leave id])
:style style/action-button} :style style/action-button}
(i18n/label :t/leave-community)]]]) (i18n/label :t/leave-community)]]]))

View File

@ -4,7 +4,6 @@
[reagent.core :as reagent] [reagent.core :as reagent]
[status-im.communities.core :as communities] [status-im.communities.core :as communities]
[utils.i18n :as i18n] [utils.i18n :as i18n]
[status-im.react-native.resources :as resources]
[status-im2.contexts.communities.menus.request-to-join.style :as style] [status-im2.contexts.communities.menus.request-to-join.style :as style]
[utils.re-frame :as rf] [utils.re-frame :as rf]
[utils.requests :as requests])) [utils.requests :as requests]))
@ -75,7 +74,7 @@
:render-fn community-rule-item}]) :render-fn community-rule-item}])
(defn request-to-join (defn request-to-join
[{:keys [permissions name id [{:keys [permissions name id images
can-join? can-request-access? can-join? can-request-access?
requested-to-join-at]}] requested-to-join-at]}]
(let [agreed-to-rules? (reagent/atom false) (let [agreed-to-rules? (reagent/atom false)
@ -93,12 +92,11 @@
[rn/view [rn/view
{:style style/request-icon} {:style style/request-icon}
[quo/icon :i/info]]] [quo/icon :i/info]]]
;; TODO get tag image from community data
[quo/context-tag [quo/context-tag
{:style {:style
{:margin-right :auto {:margin-right :auto
:margin-top 8}} :margin-top 8}}
(resources/get-image :status-logo) name] (:thumbnail images) name]
[quo/text [quo/text
{:style {:margin-top 24} {:style {:margin-top 24}
:accessibility-label :communities-rules-title :accessibility-label :communities-rules-title

View File

@ -312,9 +312,7 @@
first-channel-height (reagent/atom 0) first-channel-height (reagent/atom 0)
scroll-component (scroll-page/scroll-page scroll-component (scroll-page/scroll-page
{:uri (get-in images [:large :uri])} {:uri (get-in images [:large :uri])}
{:right-section-buttons [{:icon :i/search {:right-section-buttons [{:icon :i/options
:background-color (scroll-page/icon-color)}
{:icon :i/options
:background-color (scroll-page/icon-color) :background-color (scroll-page/icon-color)
:on-press :on-press
#(rf/dispatch #(rf/dispatch