|
71 | 71 | {:key category-id
|
72 | 72 | ;; on-layout fires only when the component re-renders, so
|
73 | 73 | ;; in case the category hasn't changed, it will not be fired
|
74 |
| - :on-layout #(on-category-layout name (int (layout-y %)))} |
| 74 | + :on-layout #(on-category-layout name category-id (int (layout-y %)))} |
75 | 75 | (when-not (= constants/empty-category-id category-id)
|
76 | 76 | [quo/divider-label
|
77 | 77 | {:on-press #(collapse-category community-id category-id collapsed?)
|
|
238 | 238 | (defn- community-header
|
239 | 239 | [title logo description]
|
240 | 240 | [quo/text-combinations
|
241 |
| - {:container-style |
242 |
| - {:margin-top |
243 |
| - (if logo |
244 |
| - 12 |
245 |
| - (+ scroll-page.style/picture-radius |
246 |
| - scroll-page.style/picture-border-width |
247 |
| - 12)) |
248 |
| - :margin-bottom 12} |
249 |
| - :avatar logo |
250 |
| - :title title |
251 |
| - :description description |
252 |
| - :title-accessibility-label :community-title |
| 241 | + {:container-style {:margin-top |
| 242 | + (if logo |
| 243 | + 12 |
| 244 | + (+ scroll-page.style/picture-radius |
| 245 | + scroll-page.style/picture-border-width |
| 246 | + 12)) |
| 247 | + :margin-bottom 12} |
| 248 | + :avatar logo |
| 249 | + :title title |
| 250 | + :title-number-of-lines 2 |
| 251 | + :description description |
| 252 | + :title-accessibility-label :community-title |
253 | 253 | :description-accessibility-label :community-description}])
|
254 | 254 |
|
255 | 255 | (defn- community-content
|
|
328 | 328 | (swap! categories-heights select-keys categories)
|
329 | 329 | (reset! first-channel-height height))]
|
330 | 330 | (fn [id joined name images]
|
331 |
| - (let [cover {:uri (get-in images [:banner :uri])} |
332 |
| - logo {:uri (get-in images [:thumbnail :uri])} |
333 |
| - collapsed? (and initial-joined? joined) |
334 |
| - overlay-shown? (boolean (:sheets (rf/sub [:bottom-sheet])))] |
| 331 | + (let [cover {:uri (get-in images [:banner :uri])} |
| 332 | + logo {:uri (get-in images [:thumbnail :uri])} |
| 333 | + collapsed? (and initial-joined? joined) |
| 334 | + first-category-height (->> @categories-heights |
| 335 | + vals |
| 336 | + (apply min) |
| 337 | + (+ @first-channel-height)) |
| 338 | + overlay-shown? (boolean (:sheets (rf/sub [:bottom-sheet])))] |
335 | 339 | [scroll-page/scroll-page
|
336 | 340 | {:cover-image cover
|
337 | 341 | :collapsed? collapsed?
|
|
347 | 351 | :community-name name
|
348 | 352 | :community-logo logo}
|
349 | 353 | :sticky-header [sticky-category-header
|
350 |
| - {:enabled (> @scroll-height @first-channel-height) |
| 354 | + {:enabled (> @scroll-height |
| 355 | + first-category-height) |
351 | 356 | :label (pick-first-category-by-height
|
352 | 357 | @scroll-height
|
353 | 358 | @first-channel-height
|
|
0 commit comments