mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-27 08:55:39 +00:00
Fix for "Rendered more hooks than during the previous render" error on closing group chat/communty channel (#16145)
* "Rendered more hooks than during the previous render" error on closing group chat/communty channel * Lint fix
This commit is contained in:
parent
c5166ac48e
commit
39ea12cf29
@ -138,25 +138,9 @@
|
|||||||
spacing-between-composer-and-content
|
spacing-between-composer-and-content
|
||||||
(when platform/ios? style/overscroll-cover-height))}])
|
(when platform/ios? style/overscroll-cover-height))}])
|
||||||
|
|
||||||
(defn f-list-footer
|
(defn f-list-footer-avatar
|
||||||
[{:keys [chat scroll-y cover-bg-color on-layout]}]
|
[{:keys [scroll-y display-name online? photo-path]}]
|
||||||
(let [{:keys [chat-id chat-name emoji chat-type
|
(let [image-scale-animation (reanimated/interpolate scroll-y
|
||||||
group-chat]} chat
|
|
||||||
all-loaded? (rf/sub [:chats/all-loaded? chat-id])
|
|
||||||
display-name (if (= chat-type constants/one-to-one-chat-type)
|
|
||||||
(first (rf/sub [:contacts/contact-two-names-by-identity chat-id]))
|
|
||||||
(str emoji " " chat-name))
|
|
||||||
{:keys [bio]} (rf/sub [:contacts/contact-by-identity chat-id])
|
|
||||||
online? (rf/sub [:visibility-status-updates/online? chat-id])
|
|
||||||
contact (when-not group-chat
|
|
||||||
(rf/sub [:contacts/contact-by-address chat-id]))
|
|
||||||
photo-path (when-not (empty? (:images contact))
|
|
||||||
(rf/sub [:chats/photo-path chat-id]))
|
|
||||||
border-animation (reanimated/interpolate scroll-y
|
|
||||||
[30 125]
|
|
||||||
[14 0]
|
|
||||||
header-extrapolation-option)
|
|
||||||
image-scale-animation (reanimated/interpolate scroll-y
|
|
||||||
scroll-animation-input-range
|
scroll-animation-input-range
|
||||||
[1 0.5]
|
[1 0.5]
|
||||||
header-extrapolation-option)
|
header-extrapolation-option)
|
||||||
@ -168,6 +152,38 @@
|
|||||||
scroll-animation-input-range
|
scroll-animation-input-range
|
||||||
[0 -20]
|
[0 -20]
|
||||||
header-extrapolation-option)]
|
header-extrapolation-option)]
|
||||||
|
[reanimated/view
|
||||||
|
{:style (style/header-image image-scale-animation
|
||||||
|
image-top-margin-animation
|
||||||
|
image-side-margin-animation)}
|
||||||
|
[quo/user-avatar
|
||||||
|
{:full-name display-name
|
||||||
|
:online? online?
|
||||||
|
:profile-picture photo-path
|
||||||
|
:size :big}]]))
|
||||||
|
|
||||||
|
(defn list-footer-avatar
|
||||||
|
[props]
|
||||||
|
[:f> f-list-footer-avatar props])
|
||||||
|
|
||||||
|
(defn f-list-footer
|
||||||
|
[{:keys [chat scroll-y cover-bg-color on-layout]}]
|
||||||
|
(let [{:keys [chat-id chat-name emoji chat-type
|
||||||
|
group-chat]} chat
|
||||||
|
all-loaded? (rf/sub [:chats/all-loaded? chat-id])
|
||||||
|
display-name (if (= chat-type constants/one-to-one-chat-type)
|
||||||
|
(first (rf/sub [:contacts/contact-two-names-by-identity chat-id]))
|
||||||
|
(str emoji " " chat-name))
|
||||||
|
{:keys [bio]} (rf/sub [:contacts/contact-by-identity chat-id])
|
||||||
|
online? (rf/sub [:visibility-status-updates/online? chat-id])
|
||||||
|
contact (when-not group-chat
|
||||||
|
(rf/sub [:contacts/contact-by-address chat-id]))
|
||||||
|
photo-path (when-not (empty? (:images contact))
|
||||||
|
(rf/sub [:chats/photo-path chat-id]))
|
||||||
|
border-animation (reanimated/interpolate scroll-y
|
||||||
|
[30 125]
|
||||||
|
[14 0]
|
||||||
|
header-extrapolation-option)]
|
||||||
[rn/view {:flex 1}
|
[rn/view {:flex 1}
|
||||||
[rn/view
|
[rn/view
|
||||||
{:style (style/header-container all-loaded?)
|
{:style (style/header-container all-loaded?)
|
||||||
@ -176,17 +192,13 @@
|
|||||||
[rn/view {:style (style/header-cover cover-bg-color)}])
|
[rn/view {:style (style/header-cover cover-bg-color)}])
|
||||||
[reanimated/view {:style (style/header-bottom-part border-animation)}
|
[reanimated/view {:style (style/header-bottom-part border-animation)}
|
||||||
[rn/view {:style style/header-avatar}
|
[rn/view {:style style/header-avatar}
|
||||||
(when-not group-chat
|
[rn/view {:style {:align-items :flex-start}}
|
||||||
[rn/view {:style {:align-items :flex-start}}
|
(when-not group-chat
|
||||||
[reanimated/view
|
[list-footer-avatar
|
||||||
{:style (style/header-image image-scale-animation
|
{:scroll-y scroll-y
|
||||||
image-top-margin-animation
|
:display-name display-name
|
||||||
image-side-margin-animation)}
|
:online? online?
|
||||||
[quo/user-avatar
|
:profile-picture photo-path}])]
|
||||||
{:full-name display-name
|
|
||||||
:online? online?
|
|
||||||
:profile-picture photo-path
|
|
||||||
:size :big}]]])
|
|
||||||
[rn/view {:style style/name-container}
|
[rn/view {:style style/name-container}
|
||||||
[quo/text
|
[quo/text
|
||||||
{:weight :semi-bold
|
{:weight :semi-bold
|
||||||
|
Loading…
x
Reference in New Issue
Block a user