From 4101057b9a7f89e3728842441c425d9a855a9fab Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 15 Nov 2023 22:45:43 +0100 Subject: [PATCH] Fix various code discrepancies --- .../intersection_observer_article.jsx | 28 +++++++++---------- .../glitch/features/domain_blocks/index.jsx | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/javascript/flavours/glitch/components/intersection_observer_article.jsx b/app/javascript/flavours/glitch/components/intersection_observer_article.jsx index 455b4cf978..8efa969f9b 100644 --- a/app/javascript/flavours/glitch/components/intersection_observer_article.jsx +++ b/app/javascript/flavours/glitch/components/intersection_observer_article.jsx @@ -106,24 +106,24 @@ export default class IntersectionObserverArticle extends Component { const { children, id, index, listLength, cachedHeight } = this.props; const { isIntersecting, isHidden } = this.state; - const style = {}; - if (!isIntersecting && (isHidden || cachedHeight)) { - style.height = `${this.height || cachedHeight || 150}px`; - style.opacity = 0; - style.overflow = 'hidden'; + return ( +
+ {children && cloneElement(children, { hidden: true })} +
+ ); } return ( -
- {children && cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })} +
+ {children && cloneElement(children, { hidden: false })}
); } diff --git a/app/javascript/flavours/glitch/features/domain_blocks/index.jsx b/app/javascript/flavours/glitch/features/domain_blocks/index.jsx index 26020a4dd2..9e63b2f817 100644 --- a/app/javascript/flavours/glitch/features/domain_blocks/index.jsx +++ b/app/javascript/flavours/glitch/features/domain_blocks/index.jsx @@ -33,7 +33,7 @@ class Blocks extends ImmutablePureComponent { params: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, hasMore: PropTypes.bool, - domains: ImmutablePropTypes.list, + domains: ImmutablePropTypes.orderedSet, intl: PropTypes.object.isRequired, multiColumn: PropTypes.bool, };