mirror of
https://github.com/status-im/status-mobile.git
synced 2025-02-26 15:21:08 +00:00
Fix incorrect background color in Community Overview screen (#16348)
Fixes the main issue #16313, but also other correlated bugs. - Fix: quo2 component navigation.page-nav does not stretch out to the maximum available height when there are only 1 to ~6 community channels. - Fix: options menu button didn't use the correct background color (it should have 40% transparency). - Fix: Remove bottom-left & bottom-right rounded borders from the bottom of the page-nav container. - Fix: Remove top-left & top-right rounded borders from the screen's header. - Fix: Use correct background color in the page-nav, now neutral-95 instead of neutral-90.
This commit is contained in:
parent
8a4cba56f6
commit
d300e88062
@ -152,7 +152,8 @@
|
|||||||
:justify-content :flex-end)}
|
:justify-content :flex-end)}
|
||||||
(let [last-icon-index (-> right-section-buttons count dec)]
|
(let [last-icon-index (-> right-section-buttons count dec)]
|
||||||
(map-indexed (fn [index
|
(map-indexed (fn [index
|
||||||
{:keys [icon on-press type style icon-override-theme accessibility-label label]
|
{:keys [icon on-press type style icon-override-theme icon-background-color
|
||||||
|
accessibility-label label]
|
||||||
:or {type :grey}}]
|
:or {type :grey}}]
|
||||||
^{:key index}
|
^{:key index}
|
||||||
[rn/view
|
[rn/view
|
||||||
@ -167,7 +168,8 @@
|
|||||||
:type type
|
:type type
|
||||||
:before (when label icon)
|
:before (when label icon)
|
||||||
:size 32
|
:size 32
|
||||||
:override-theme icon-override-theme}
|
:override-theme icon-override-theme
|
||||||
|
:override-background-color icon-background-color}
|
||||||
(if label label icon)]])
|
(if label label icon)]])
|
||||||
right-section-buttons))])
|
right-section-buttons))])
|
||||||
|
|
||||||
|
@ -27,16 +27,6 @@
|
|||||||
colors/neutral-95-opa-70)
|
colors/neutral-95-opa-70)
|
||||||
:transparent)}))
|
:transparent)}))
|
||||||
|
|
||||||
(defn scroll-view-container
|
|
||||||
[border-radius]
|
|
||||||
{:flex 1
|
|
||||||
:position :absolute
|
|
||||||
:top (if platform/ios? -48 0)
|
|
||||||
:left 0
|
|
||||||
:right 0
|
|
||||||
:overflow :scroll
|
|
||||||
:border-radius border-radius})
|
|
||||||
|
|
||||||
(defn sticky-header-title
|
(defn sticky-header-title
|
||||||
[animation]
|
[animation]
|
||||||
(reanimated/apply-animations-to-style
|
(reanimated/apply-animations-to-style
|
||||||
@ -55,24 +45,29 @@
|
|||||||
:height 24
|
:height 24
|
||||||
:margin-right 8})
|
:margin-right 8})
|
||||||
|
|
||||||
|
(defn children-container
|
||||||
|
[{:keys [border-radius background-color]}]
|
||||||
|
{:flex 1
|
||||||
|
:border-top-left-radius border-radius
|
||||||
|
:border-top-right-radius border-radius
|
||||||
|
:background-color background-color})
|
||||||
|
|
||||||
|
(def picture-radius 40)
|
||||||
|
(def picture-diameter (* 2 picture-radius))
|
||||||
|
(def picture-border-width 4)
|
||||||
|
|
||||||
(defn display-picture-container
|
(defn display-picture-container
|
||||||
[animation]
|
[animation]
|
||||||
(reanimated/apply-animations-to-style
|
(reanimated/apply-animations-to-style
|
||||||
{:transform [{:scale animation}]}
|
{:transform [{:scale animation}]}
|
||||||
{:border-radius 50
|
{:border-radius picture-diameter
|
||||||
:border-width 1
|
:border-width picture-border-width
|
||||||
:border-color colors/white
|
:border-color (colors/theme-colors colors/white colors/neutral-95)
|
||||||
:position :absolute
|
:position :absolute
|
||||||
:top -40
|
:top (- (+ picture-radius picture-border-width))
|
||||||
:left 17
|
:left (- (/ picture-radius 2) picture-border-width)}))
|
||||||
:padding 2
|
|
||||||
:background-color (colors/theme-colors
|
|
||||||
colors/white
|
|
||||||
colors/neutral-90)}))
|
|
||||||
|
|
||||||
(def display-picture
|
(def display-picture
|
||||||
{:border-radius 50
|
{:border-radius picture-diameter
|
||||||
:border-width 0
|
:width picture-diameter
|
||||||
:border-color :transparent
|
:height picture-diameter})
|
||||||
:width 80
|
|
||||||
:height 80})
|
|
||||||
|
@ -118,8 +118,7 @@
|
|||||||
[:f> f-scroll-page-header @scroll-height height name page-nav-right-section-buttons
|
[:f> f-scroll-page-header @scroll-height height name page-nav-right-section-buttons
|
||||||
logo sticky-header top-nav title-colum navigate-back?]
|
logo sticky-header top-nav title-colum navigate-back?]
|
||||||
[rn/scroll-view
|
[rn/scroll-view
|
||||||
{:content-container-style (style/scroll-view-container
|
{:content-container-style {:flex-grow 1}
|
||||||
(diff-with-max-min @scroll-height 16 0))
|
|
||||||
:shows-vertical-scroll-indicator false
|
:shows-vertical-scroll-indicator false
|
||||||
:scroll-event-throttle 16
|
:scroll-event-throttle 16
|
||||||
:on-scroll (fn [^js event]
|
:on-scroll (fn [^js event]
|
||||||
@ -140,9 +139,8 @@
|
|||||||
:flex 1}}]])
|
:flex 1}}]])
|
||||||
(when children
|
(when children
|
||||||
[rn/view
|
[rn/view
|
||||||
{:flex 1
|
{:style (style/children-container {:border-radius (diff-with-max-min @scroll-height 16 0)
|
||||||
:border-radius (diff-with-max-min @scroll-height 16 0)
|
:background-color background-color})}
|
||||||
:background-color background-color}
|
|
||||||
(when cover-image
|
(when cover-image
|
||||||
[:f> f-display-picture @scroll-height logo])
|
[:f> f-display-picture @scroll-height logo])
|
||||||
children])]])))
|
children])]])))
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
[status-im2.common.home.actions.view :as actions]
|
[status-im2.common.home.actions.view :as actions]
|
||||||
[status-im2.common.password-authentication.view :as password-authentication]
|
[status-im2.common.password-authentication.view :as password-authentication]
|
||||||
[status-im2.common.scroll-page.view :as scroll-page]
|
[status-im2.common.scroll-page.view :as scroll-page]
|
||||||
|
[status-im2.common.scroll-page.style :as scroll-page.style]
|
||||||
[status-im2.constants :as constants]
|
[status-im2.constants :as constants]
|
||||||
[status-im2.contexts.communities.actions.community-options.view :as options]
|
[status-im2.contexts.communities.actions.community-options.view :as options]
|
||||||
[status-im2.contexts.communities.overview.style :as style]
|
[status-im2.contexts.communities.overview.style :as style]
|
||||||
@ -250,7 +251,9 @@
|
|||||||
:ellipsize-mode :tail
|
:ellipsize-mode :tail
|
||||||
:weight :semi-bold
|
:weight :semi-bold
|
||||||
:size :heading-1
|
:size :heading-1
|
||||||
:style {:margin-top 56}}
|
:style {:margin-top (+ scroll-page.style/picture-radius
|
||||||
|
scroll-page.style/picture-border-width
|
||||||
|
12)}}
|
||||||
name])
|
name])
|
||||||
|
|
||||||
(defn community-description
|
(defn community-description
|
||||||
@ -302,7 +305,7 @@
|
|||||||
(defn page-nav-right-section-buttons
|
(defn page-nav-right-section-buttons
|
||||||
[id]
|
[id]
|
||||||
[{:icon :i/options
|
[{:icon :i/options
|
||||||
:background-color (scroll-page/icon-color)
|
:icon-background-color (scroll-page/icon-color)
|
||||||
:accessibility-label :community-options-for-community
|
:accessibility-label :community-options-for-community
|
||||||
:on-press #(rf/dispatch
|
:on-press #(rf/dispatch
|
||||||
[:show-bottom-sheet
|
[:show-bottom-sheet
|
||||||
@ -336,7 +339,7 @@
|
|||||||
:name name
|
:name name
|
||||||
:on-scroll #(reset! scroll-height %)
|
:on-scroll #(reset! scroll-height %)
|
||||||
:navigate-back? true
|
:navigate-back? true
|
||||||
:background-color (colors/theme-colors colors/white colors/neutral-90)
|
:background-color (colors/theme-colors colors/white colors/neutral-95)
|
||||||
:height (if platform/ios? 100 148)}
|
:height (if platform/ios? 100 148)}
|
||||||
[sticky-category-header
|
[sticky-category-header
|
||||||
{:enabled (> @scroll-height @first-channel-height)
|
{:enabled (> @scroll-height @first-channel-height)
|
||||||
@ -350,8 +353,8 @@
|
|||||||
pending?
|
pending?
|
||||||
{:on-category-layout (partial add-category-height categories-heights)
|
{:on-category-layout (partial add-category-height categories-heights)
|
||||||
:on-first-channel-height-changed
|
:on-first-channel-height-changed
|
||||||
;; Here we set the height of the component
|
;; Here we set the height of the component and we filter out the
|
||||||
;; and we filter out the categories, as some might have been removed
|
;; categories, as some might have been removed
|
||||||
(fn [height categories]
|
(fn [height categories]
|
||||||
(swap! categories-heights select-keys categories)
|
(swap! categories-heights select-keys categories)
|
||||||
(reset! first-channel-height height))}]]))))
|
(reset! first-channel-height height))}]]))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user