From ecdef1d95b0eda9258791b61df6630f47f5156d7 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 12 Oct 2021 20:03:55 -0500 Subject: [PATCH] Placeholder: render placeholder parent status in thread --- .../features/status/components/thread_status.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/soapbox/features/status/components/thread_status.js b/app/soapbox/features/status/components/thread_status.js index 3df38013a..91ba4bfad 100644 --- a/app/soapbox/features/status/components/thread_status.js +++ b/app/soapbox/features/status/components/thread_status.js @@ -3,12 +3,14 @@ import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import StatusContainer from 'soapbox/containers/status_container'; import { OrderedSet as ImmutableOrderedSet } from 'immutable'; +import PlaceholderStatus from 'soapbox/features/placeholder/components/placeholder_status'; import classNames from 'classnames'; const mapStateToProps = (state, { id }) => { return { - replyToId: state.getIn(['statuses', id, 'in_reply_to_id']), + replyToId: state.getIn(['contexts', 'inReplyTos', id]), replyCount: state.getIn(['contexts', 'replies', id], ImmutableOrderedSet()).size, + isLoaded: Boolean(state.getIn(['statuses', id])), }; }; @@ -19,6 +21,7 @@ class ThreadStatus extends React.Component { focusedStatusId: PropTypes.string, replyToId: PropTypes.string, replyCount: PropTypes.number, + isLoaded: PropTypes.bool, } renderConnector() { @@ -43,10 +46,16 @@ class ThreadStatus extends React.Component { } render() { + const { isLoaded } = this.props; + return (
{this.renderConnector()} - + {isLoaded ? ( + + ) : ( + + )}
); }