Skip to content

Commit

Permalink
fix community category divider label margin
Browse files Browse the repository at this point in the history
  • Loading branch information
Parveshdhull committed Apr 29, 2024
1 parent 2ec6a3e commit 90eda0c
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/status_im/contexts/communities/overview/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@

(defn- channel-chat-item
[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
(assoc chat
:community-id community-id
Expand All @@ -56,7 +57,7 @@
:notification notification}
channel-sheet-data {:selected-item (fn [] [quo/channel channel-options])
:content (fn [] sheet-content)}]
[rn/view {:key id}
[rn/view {:key id :style (when last-item? {:margin-bottom 8})}
[quo/channel
(assoc channel-options
:on-press on-press
Expand All @@ -78,16 +79,17 @@
:on-layout #(on-category-layout name category-id (int (layout-y %)))}
(when-not (= constants/empty-category-id category-id)
[quo/divider-label
{:on-press #(collapse-category community-id category-id collapsed?)
:chevron-icon (if collapsed? :i/chevron-right :i/chevron-down)
:container-style {:margin-top 8}
:chevron :left}
{:on-press #(collapse-category community-id category-id collapsed?)
:chevron-icon (if collapsed? :i/chevron-right :i/chevron-down)
:chevron :left}
name])
(when-not collapsed?
[rn/view {:style {:padding-horizontal 8}}
(for [chat chats]
^{:key (:id chat)}
[channel-chat-item community-id chat])])])])
(let [chats-count (count chats)]
(for [index (range chats-count)]
(let [chat (get chats index)]
^{:key (:id chat)}
[channel-chat-item community-id chat (= index (dec chats-count))])))])])])

(defn- get-access-type
[access]
Expand Down

0 comments on commit 90eda0c

Please sign in to comment.