Skip to content

Commit

Permalink
fix: hide channel category sticky header for none
Browse files Browse the repository at this point in the history
  • Loading branch information
clauxx authored and BalogunofAfrica committed Feb 1, 2024
1 parent b5b6038 commit 37b4cd2
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/status_im/contexts/communities/overview/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
{:key category-id
;; on-layout fires only when the component re-renders, so
;; in case the category hasn't changed, it will not be fired
:on-layout #(on-category-layout name (int (layout-y %)))}
: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?)
Expand Down Expand Up @@ -306,10 +306,14 @@
;; user is on this page
initial-joined? joined]
(fn [{:keys [id name images] :as community}]
(let [cover {:uri (get-in images [:banner :uri])}
logo {:uri (get-in images [:thumbnail :uri])}
collapsed? (and initial-joined? (:joined community))
overlay-shown? (boolean (:sheets (rf/sub [:bottom-sheet])))]
(let [cover {:uri (get-in images [:banner :uri])}
logo {:uri (get-in images [:thumbnail :uri])}
collapsed? (and initial-joined? (:joined community))
first-category-height (->> @categories-heights
vals
(apply min)
(+ @first-channel-height))
overlay-shown? (boolean (:sheets (rf/sub [:bottom-sheet])))]
[scroll-page/scroll-page
{:cover-image cover
:collapsed? collapsed?
Expand All @@ -325,7 +329,8 @@
:community-name name
:community-logo logo}
:sticky-header [sticky-category-header
{:enabled (> @scroll-height @first-channel-height)
{:enabled (> @scroll-height
first-category-height)
:label (pick-first-category-by-height
@scroll-height
@first-channel-height
Expand Down

0 comments on commit 37b4cd2

Please sign in to comment.