fix community category divider label margin (#19827)
This commit is contained in:
parent
aaf5b72675
commit
17f6a72590
|
@ -35,7 +35,8 @@
|
||||||
|
|
||||||
(defn- channel-chat-item
|
(defn- channel-chat-item
|
||||||
[community-id
|
[community-id
|
||||||
{:keys [name emoji muted? id mentions-count unread-messages? on-press locked? color] :as chat}]
|
{:keys [name emoji muted? id mentions-count unread-messages? on-press locked? color] :as chat}
|
||||||
|
last-item?]
|
||||||
(let [sheet-content [actions/chat-actions
|
(let [sheet-content [actions/chat-actions
|
||||||
(assoc chat
|
(assoc chat
|
||||||
:community-id community-id
|
:community-id community-id
|
||||||
|
@ -56,7 +57,7 @@
|
||||||
:notification notification}
|
:notification notification}
|
||||||
channel-sheet-data {:selected-item (fn [] [quo/channel channel-options])
|
channel-sheet-data {:selected-item (fn [] [quo/channel channel-options])
|
||||||
:content (fn [] sheet-content)}]
|
:content (fn [] sheet-content)}]
|
||||||
[rn/view {:key id}
|
[rn/view {:key id :style (when last-item? {:margin-bottom 8})}
|
||||||
[quo/channel
|
[quo/channel
|
||||||
(assoc channel-options
|
(assoc channel-options
|
||||||
:on-press on-press
|
:on-press on-press
|
||||||
|
@ -80,14 +81,16 @@
|
||||||
[quo/divider-label
|
[quo/divider-label
|
||||||
{:on-press #(collapse-category community-id category-id collapsed?)
|
{:on-press #(collapse-category community-id category-id collapsed?)
|
||||||
:chevron-icon (if collapsed? :i/chevron-right :i/chevron-down)
|
:chevron-icon (if collapsed? :i/chevron-right :i/chevron-down)
|
||||||
:container-style {:margin-top 8}
|
|
||||||
:chevron :left}
|
:chevron :left}
|
||||||
name])
|
name])
|
||||||
(when-not collapsed?
|
(when-not collapsed?
|
||||||
[rn/view {:style {:padding-horizontal 8}}
|
[rn/view {:style {:padding-horizontal 8}}
|
||||||
(for [chat chats]
|
(let [last-item-index (dec (count chats))]
|
||||||
|
(map-indexed
|
||||||
|
(fn [index chat]
|
||||||
^{:key (:id chat)}
|
^{:key (:id chat)}
|
||||||
[channel-chat-item community-id chat])])])])
|
[channel-chat-item community-id chat (= index last-item-index)])
|
||||||
|
chats))])])])
|
||||||
|
|
||||||
(defn- get-access-type
|
(defn- get-access-type
|
||||||
[access]
|
[access]
|
||||||
|
|
Loading…
Reference in New Issue