fix: banner images/colors in shell (#16239)

This commit is contained in:
codemaster 2023-07-12 10:56:43 -04:00 committed by GitHub
parent c55f12ecf8
commit 645a5b312b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 12 deletions

View File

@ -246,7 +246,8 @@
([color suffix opacity] ([color suffix opacity]
(let [color-keyword (keyword color) (let [color-keyword (keyword color)
base-color (get-in colors-map base-color (get-in colors-map
[color-keyword suffix])] [color-keyword suffix]
color)]
(if opacity (alpha base-color (/ opacity 100)) base-color)))))) (if opacity (alpha base-color (/ opacity 100)) base-color))))))
(defn custom-color-by-theme (defn custom-color-by-theme

View File

@ -375,7 +375,8 @@
[keyboard-shown keyboard-height]) [keyboard-shown keyboard-height])
[rn/keyboard-avoiding-view [rn/keyboard-avoiding-view
{:style (style/keyboard-avoiding-container insets) {:style (style/keyboard-avoiding-container insets)
:keyboard-vertical-offset (- (:bottom insets))} :keyboard-vertical-offset (- (:bottom insets))
:behavior :height}
(when header-comp (when header-comp
[header-comp [header-comp

View File

@ -83,7 +83,7 @@
;; Mocked Data ;; Mocked Data
(def banner {:source (resources/get-mock-image :community-banner)}) (def banner (resources/get-mock-image :community-banner))
(def sticker {:source (resources/get-mock-image :sticker)}) (def sticker {:source (resources/get-mock-image :sticker)})
(def community-avatar {:source (resources/get-mock-image :community-logo)}) (def community-avatar {:source (resources/get-mock-image :community-logo)})
(def gif {:source (resources/get-mock-image :gif)}) (def gif {:source (resources/get-mock-image :gif)})

View File

@ -73,7 +73,7 @@
[rn/flat-list [rn/flat-list
{:data data {:data data
:render-fn render-card :render-fn render-card
:key-fn :id :key-fn :screen-id
:header (jump-to-text) :header (jump-to-text)
:ref #(reset! state/jump-to-list-ref %) :ref #(reset! state/jump-to-list-ref %)
:num-columns 2 :num-columns 2

View File

@ -15,6 +15,7 @@
{:width 160 {:width 160
:height 160 :height 160
:border-radius 16 :border-radius 16
:overflow :hidden
:background-color (colors/alpha background-color 0.4)}) :background-color (colors/alpha background-color 0.4)})
(defn empty-card (defn empty-card

View File

@ -235,8 +235,9 @@
[rn/view {:style (style/base-container color-50)} [rn/view {:style (style/base-container color-50)}
(when banner (when banner
[rn/image [rn/image
{:source (:source banner) {:source banner
:style {:width 160}}]) :style {:width 160
:height 65}}])
[rn/view {:style style/secondary-container} [rn/view {:style style/secondary-container}
[quo/text [quo/text
{:size :paragraph-1 {:size :paragraph-1
@ -250,7 +251,10 @@
:weight :medium :weight :medium
:style style/subtitle} :style style/subtitle}
(subtitle type content)] (subtitle type content)]
[bottom-container type (merge {:color-50 color-50 :color-60 color-60} content)]] [bottom-container type
(merge {:color-50 color-50
:color-60 color-60}
content)]]
(when avatar-params (when avatar-params
[rn/view {:style style/avatar-container} [rn/view {:style style/avatar-container}
[avatar avatar-params type customization-color]]) [avatar avatar-params type customization-color]])

View File

@ -89,7 +89,7 @@
[chat id communities primary-name] [chat id communities primary-name]
{:title (:chat-name chat) {:title (:chat-name chat)
:avatar-params {} :avatar-params {}
:customization-color (or (:customization-color chat) :primary) :customization-color (or (:color chat) :primary)
:content (get-card-content :content (get-card-content
{:chat chat {:chat chat
:communities communities :communities communities
@ -101,10 +101,11 @@
[community id] [community id]
(let [profile-picture (community-avatar community)] (let [profile-picture (community-avatar community)]
{:title (:name community) {:title (:name community)
:banner {:uri (get-in (:images community) [:banner :uri])}
:avatar-params (if profile-picture :avatar-params (if profile-picture
{:source profile-picture} {:source profile-picture}
{:name (:name community)}) {:name (:name community)})
:customization-color (or (:customization-color community) :primary) :customization-color (or (:color community) :primary)
:content {:community-info {:type :permission}} :content {:community-info {:type :permission}}
:id id})) :id id}))
@ -114,6 +115,7 @@
(community-card community community-id) (community-card community community-id)
{:content {:community-channel {:emoji (:emoji channel) {:content {:community-channel {:emoji (:emoji channel)
:channel-name (str "# " (:name channel))}} :channel-name (str "# " (:name channel))}}
:customization-color (or (:color channel) :primary)
:channel-id channel-id})) :channel-id channel-id}))
;;;; Subscriptions ;;;; Subscriptions