gab-social/app/javascript/gabsocial/components/status.js

637 lines
20 KiB
JavaScript
Raw Normal View History

import { Fragment } from 'react'
2020-04-22 06:00:11 +01:00
import ImmutablePropTypes from 'react-immutable-proptypes'
import { defineMessages, injectIntl } from 'react-intl'
2020-04-22 06:00:11 +01:00
import ImmutablePureComponent from 'react-immutable-pure-component'
import { HotKeys } from 'react-hotkeys'
import {
CX,
COMMENT_SORTING_TYPE_NEWEST,
COMMENT_SORTING_TYPE_TOP,
} from '../constants'
import { me, displayMedia } from '../initial_state'
2020-05-06 05:33:54 +01:00
import scheduleIdleTask from '../utils/schedule_idle_task'
2020-04-11 23:29:19 +01:00
import ComposeFormContainer from '../features/compose/containers/compose_form_container'
2020-05-06 05:33:54 +01:00
import ResponsiveClassesComponent from '../features/ui/util/responsive_classes_component'
import CommentPlaceholder from './placeholder/comment_placeholder'
2020-04-11 23:29:19 +01:00
import StatusContent from './status_content'
import StatusPrepend from './status_prepend'
2020-04-22 06:00:11 +01:00
import StatusActionBar from './status_action_bar'
2020-05-02 07:25:55 +01:00
import StatusMedia from './status_media'
2020-04-11 23:29:19 +01:00
import StatusHeader from './status_header'
2020-04-22 06:00:11 +01:00
import CommentList from './comment_list'
import Button from './button'
import Text from './text'
import SortBlock from './sort_block'
import ColumnIndicator from './column_indicator'
// We use the component (and not the container) since we do not want
// to use the progress bar to show download progress
2020-04-22 06:00:11 +01:00
import Bundle from '../features/ui/util/bundle'
const messages = defineMessages({
sortBy: { id: 'comment_sort.title', defaultMessage: 'Sort by' },
oldest: { id: 'comment_sort.oldest', defaultMessage: 'Oldest' },
newest: { id: 'comment_sort.newest', defaultMessage: 'Recent' },
top: { id: 'comment_sort.top', defaultMessage: 'Most Liked' },
})
2020-02-28 15:20:47 +00:00
export const textForScreenReader = (intl, status, rebloggedByText = false) => {
2020-04-22 06:00:11 +01:00
if (!intl || !status) return ''
const displayName = status.getIn(['account', 'display_name'])
2020-05-04 19:44:37 +01:00
// : todo :
const values = [
2020-05-04 19:44:37 +01:00
// displayName.length === 0 ? status.getIn(['account', 'acct']).split('@')[0] : displayName,
// status.get('spoiler_text') && status.get('hidden')
// ? status.get('spoiler_text')
// : status.get('search_index').slice(status.get('spoiler_text').length),
// intl.formatDate(status.get('created_at'), { hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' }),
// `@${status.getIn(['account', 'acct'])}`,
2020-04-22 06:00:11 +01:00
]
if (rebloggedByText) {
2020-04-22 06:00:11 +01:00
values.push(rebloggedByText)
}
2020-04-22 06:00:11 +01:00
return values.join(', ')
}
2020-04-22 06:00:11 +01:00
export const defaultMediaVisibility = (status) => {
2020-04-02 04:17:21 +01:00
if (!status) return undefined
if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') {
2020-04-02 04:17:21 +01:00
status = status.get('reblog')
}
2020-04-02 04:17:21 +01:00
return (displayMedia !== 'hide_all' && !status.get('sensitive')) || displayMedia === 'show_all'
}
2020-02-25 16:04:44 +00:00
export default
@injectIntl
class Status extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
2020-04-22 06:00:11 +01:00
}
static propTypes = {
2020-04-22 06:00:11 +01:00
intl: PropTypes.object.isRequired,
status: ImmutablePropTypes.map,
2020-04-22 06:00:11 +01:00
descendantsIds: ImmutablePropTypes.list,
2020-05-04 19:44:37 +01:00
ancestorStatus: ImmutablePropTypes.map,
2020-05-14 07:03:22 +01:00
isNotification: PropTypes.bool,
2020-04-22 06:00:11 +01:00
isChild: PropTypes.bool,
isPromoted: PropTypes.bool,
isFeatured: PropTypes.bool,
isMuted: PropTypes.bool,
isHidden: PropTypes.bool,
isIntersecting: PropTypes.bool,
2020-05-05 06:16:01 +01:00
isComment: PropTypes.bool,
onClick: PropTypes.func,
onReply: PropTypes.func,
2020-04-24 04:17:27 +01:00
onRepost: PropTypes.func,
onQuote: PropTypes.func,
2020-03-04 22:26:01 +00:00
onFavorite: PropTypes.func,
onMention: PropTypes.func,
onOpenMedia: PropTypes.func,
onOpenVideo: PropTypes.func,
onHeightChange: PropTypes.func,
onToggleHidden: PropTypes.func,
2020-04-22 06:00:11 +01:00
onShare: PropTypes.func,
onMoveUp: PropTypes.func,
onMoveDown: PropTypes.func,
2020-04-22 06:00:11 +01:00
onFetchComments: PropTypes.func,
2020-05-05 06:16:01 +01:00
onFetchContext: PropTypes.func,
getScrollPosition: PropTypes.func,
updateScrollBottom: PropTypes.func,
cacheMediaWidth: PropTypes.func,
cachedMediaWidth: PropTypes.number,
2020-04-22 06:00:11 +01:00
contextType: PropTypes.string,
2020-05-02 07:25:55 +01:00
commentsLimited: PropTypes.bool,
2020-05-03 06:22:49 +01:00
onOpenLikes: PropTypes.func.isRequired,
onOpenReposts: PropTypes.func.isRequired,
onCommentSortOpen: PropTypes.func.isRequired,
2020-05-07 00:40:54 +01:00
isComposeModalOpen: PropTypes.bool,
commentSortingType: PropTypes.string,
2020-04-02 04:17:21 +01:00
}
// Avoid checking props that are functions (and whose equality will always
// evaluate to false. See react-immutable-pure-component for usage.
2020-04-22 06:00:11 +01:00
updateOnProps = [
'status',
'descendantsIds',
'isChild',
'isPromoted',
'isFeatured',
'isMuted',
'isHidden',
'isIntersecting',
2020-05-05 06:16:01 +01:00
'isComment',
'commentSortingType',
2020-04-22 06:00:11 +01:00
]
state = {
2020-04-22 06:00:11 +01:00
loadedComments: false,
showMedia: defaultMediaVisibility(this.props.status),
statusId: undefined,
2020-04-22 06:00:11 +01:00
height: undefined,
2020-04-02 04:17:21 +01:00
}
// Track height changes we know about to compensate scrolling
componentDidMount() {
2020-04-22 06:00:11 +01:00
const { isMuted, isHidden, status } = this.props
this.didShowCard = !isMuted && !isHidden && status && status.get('card')
}
getSnapshotBeforeUpdate() {
if (this.props.getScrollPosition) {
2020-04-02 04:17:21 +01:00
return this.props.getScrollPosition()
}
2020-04-02 04:17:21 +01:00
return null
}
static getDerivedStateFromProps(nextProps, prevState) {
2020-05-05 06:16:01 +01:00
if (nextProps.isChild) return null
2020-05-15 03:31:24 +01:00
2020-05-02 07:25:55 +01:00
if (!nextProps.isHidden && (nextProps.isIntersecting || !nextProps.commentsLimited) && !prevState.loadedComments) {
2020-04-22 06:00:11 +01:00
return {
loadedComments: true
}
}
if (nextProps.status && nextProps.status.get('id') !== prevState.statusId) {
return {
2020-05-04 19:44:37 +01:00
loadedComments: false, //reset
showMedia: defaultMediaVisibility(nextProps.status),
statusId: nextProps.status.get('id'),
2020-04-22 06:00:11 +01:00
}
}
2020-04-22 06:00:11 +01:00
return null
}
// Compensate height changes
componentDidUpdate(prevProps, prevState, snapshot) {
2020-05-02 07:25:55 +01:00
// timeline lazy loading comments
if (!prevState.loadedComments && this.state.loadedComments && this.props.status && !this.props.isChild && this.props.contextType !== 'feature') {
2020-04-23 07:13:29 +01:00
const commentCount = this.props.status.get('replies_count')
2020-05-15 03:31:24 +01:00
if (this.props.isComment && !this.props.ancestorStatus) {
2020-05-05 06:16:01 +01:00
this.props.onFetchContext(this.props.status.get('id'))
2020-05-06 05:33:54 +01:00
this._measureHeight(prevState.height !== this.state.height)
} else {
if (commentCount > 0 && !this.props.commentsLimited) {
2020-05-06 05:33:54 +01:00
this._measureHeight(prevState.height !== this.state.height)
this.props.onFetchComments(this.props.status.get('id'))
}
2020-04-22 06:00:11 +01:00
}
}
const doShowCard = !this.props.isMuted && !this.props.isHidden && this.props.status && this.props.status.get('card')
if (doShowCard && !this.didShowCard) {
2020-04-22 06:00:11 +01:00
this.didShowCard = true
if (snapshot !== null && this.props.updateScrollBottom) {
if (this.node && this.node.offsetTop < snapshot.top) {
2020-05-15 04:36:10 +01:00
// console.log("updateScrollBottom")
2020-04-22 06:00:11 +01:00
this.props.updateScrollBottom(snapshot.height - snapshot.top)
}
}
}
}
2020-05-02 07:25:55 +01:00
handleMoveUp = (id) => {
2020-04-23 07:13:29 +01:00
const { status, ancestorsIds, descendantsIds } = this.props
2020-04-22 06:00:11 +01:00
if (id === status.get('id')) {
2020-04-23 07:13:29 +01:00
this._selectChild(ancestorsIds.size - 1, true)
2020-04-22 06:00:11 +01:00
} else {
2020-04-23 07:13:29 +01:00
let index = ancestorsIds.indexOf(id)
2020-04-22 06:00:11 +01:00
if (index === -1) {
2020-04-23 07:13:29 +01:00
index = descendantsIds.indexOf(id)
this._selectChild(ancestorsIds.size + index, true)
2020-04-22 06:00:11 +01:00
} else {
2020-04-23 07:13:29 +01:00
this._selectChild(index - 1, true)
2020-04-22 06:00:11 +01:00
}
}
}
handleMoveDown = id => {
2020-04-23 07:13:29 +01:00
const { status, ancestorsIds, descendantsIds } = this.props
2020-04-22 06:00:11 +01:00
if (id === status.get('id')) {
2020-04-23 07:13:29 +01:00
this._selectChild(ancestorsIds.size + 1, false)
2020-04-22 06:00:11 +01:00
} else {
2020-04-23 07:13:29 +01:00
let index = ancestorsIds.indexOf(id)
2020-04-22 06:00:11 +01:00
if (index === -1) {
2020-04-23 07:13:29 +01:00
index = descendantsIds.indexOf(id)
this._selectChild(ancestorsIds.size + index + 2, false)
2020-04-22 06:00:11 +01:00
} else {
2020-04-23 07:13:29 +01:00
this._selectChild(index + 1, false)
2020-04-22 06:00:11 +01:00
}
}
}
_selectChild(index, align_top) {
2020-04-23 07:13:29 +01:00
const container = this.node
const element = container.querySelectorAll('.focusable')[index]
2020-04-22 06:00:11 +01:00
if (element) {
if (align_top && container.scrollTop > element.offsetTop) {
2020-04-23 07:13:29 +01:00
element.scrollIntoView(true)
2020-04-22 06:00:11 +01:00
} else if (!align_top && container.scrollTop + container.clientHeight < element.offsetTop + element.offsetHeight) {
2020-04-23 07:13:29 +01:00
element.scrollIntoView(false)
2020-04-22 06:00:11 +01:00
}
2020-04-23 07:13:29 +01:00
element.focus()
2020-04-22 06:00:11 +01:00
}
}
componentWillUnmount() {
if (this.node && this.props.getScrollPosition) {
2020-04-22 06:00:11 +01:00
const position = this.props.getScrollPosition()
if (position !== null && this.node.offsetTop < position.top) {
requestAnimationFrame(() => {
2020-04-22 06:00:11 +01:00
this.props.updateScrollBottom(position.height - position.top)
})
}
}
}
handleToggleMediaVisibility = () => {
2020-03-07 04:53:28 +00:00
this.setState({ showMedia: !this.state.showMedia })
}
handleClick = () => {
if (this.props.onClick) {
2020-04-22 06:00:11 +01:00
this.props.onClick()
return
}
2020-04-22 06:00:11 +01:00
if (!this.context.router) return
this.context.router.history.push(
`/${this._properStatus().getIn(['account', 'acct'])}/posts/${this._properStatus().get('id')}`
2020-03-07 04:53:28 +00:00
)
}
handleExpandClick = e => {
if (e.button === 0) {
2020-04-22 06:00:11 +01:00
if (!this.context.router) return
this.context.router.history.push(
`/${this._properStatus().getIn(['account', 'acct'])}/posts/${this._properStatus().get('id')}`
2020-04-22 06:00:11 +01:00
)
}
2020-04-22 06:00:11 +01:00
}
handleExpandedToggle = () => {
2020-04-22 06:00:11 +01:00
this.props.onToggleHidden(this._properStatus())
}
2020-04-22 06:00:11 +01:00
renderLoadingMedia() {
return <div className={_s.backgroundColorPanel} style={{ height: '110px' }} />
}
handleOpenVideo = (media, startTime) => {
2020-04-22 06:00:11 +01:00
this.props.onOpenVideo(media, startTime)
}
2020-05-15 04:17:31 +01:00
handleHotkeyReply = (e) => {
2020-04-22 06:00:11 +01:00
e.preventDefault()
2020-05-15 04:17:31 +01:00
this.props.onReply(this._properStatus(), this.context.router)
}
handleOnReply = (status) => {
this.props.onReply(status || this._properStatus(), this.context.router, true)
2020-04-22 06:00:11 +01:00
}
handleOnQuote = (status) => {
this.props.onQuote(status || this._properStatus(), this.context.router)
}
2020-03-04 22:26:01 +00:00
handleHotkeyFavorite = () => {
2020-04-22 06:00:11 +01:00
this.props.onFavorite(this._properStatus())
}
2020-04-22 06:00:11 +01:00
handleHotkeyRepost = e => {
this.props.onQuote(this._properStatus(), e)
}
handleHotkeyMention = e => {
2020-04-22 06:00:11 +01:00
e.preventDefault()
2020-05-15 04:17:31 +01:00
this.props.onMention(this._properStatus().get('account'), this.context.router)
2020-04-22 06:00:11 +01:00
}
handleHotkeyOpen = () => {
this.context.router.history.push(
`/${this._properStatus().getIn(['account', 'acct'])}/posts/${this._properStatus().get('id')}`
2020-04-22 06:00:11 +01:00
)
}
handleHotkeyOpenProfile = () => {
2020-04-22 06:00:11 +01:00
this.context.router.history.push(`/${this._properStatus().getIn(['account', 'acct'])}`)
}
handleHotkeyMoveUp = e => {
2020-04-02 04:17:21 +01:00
this.props.onMoveUp(this.props.status.get('id'), e.target.getAttribute('data-featured'))
}
handleHotkeyMoveDown = e => {
2020-04-02 04:17:21 +01:00
this.props.onMoveDown(this.props.status.get('id'), e.target.getAttribute('data-featured'))
}
handleHotkeyToggleHidden = () => {
2020-04-02 04:17:21 +01:00
this.props.onToggleHidden(this._properStatus())
}
handleHotkeyToggleSensitive = () => {
2020-04-02 04:17:21 +01:00
this.handleToggleMediaVisibility()
}
_properStatus() {
2020-05-05 06:16:01 +01:00
const { status, ancestorStatus } = this.props
if (ancestorStatus) {
return ancestorStatus
}
if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') {
2020-04-02 04:17:21 +01:00
return status.get('reblog')
}
2020-04-02 04:17:21 +01:00
return status
}
2020-05-06 05:33:54 +01:00
_measureHeight(heightJustChanged) {
2020-04-22 06:00:11 +01:00
try {
scheduleIdleTask(() => this.node && this.setState({ height: Math.ceil(this.node.scrollHeight) + 1 }))
2020-05-06 05:33:54 +01:00
2020-04-22 06:00:11 +01:00
if (heightJustChanged) {
this.props.onHeightChange()
2020-05-06 05:33:54 +01:00
}
2020-04-22 06:00:11 +01:00
} catch (error) {
2020-05-06 05:33:54 +01:00
//
2020-04-22 06:00:11 +01:00
}
2020-04-02 04:17:21 +01:00
}
handleOnCommentSortOpen = (btn) => {
this.props.onCommentSortOpen(btn)
}
handleRef = (c) => {
2020-04-22 06:00:11 +01:00
this.node = c
this._measureHeight()
2020-02-22 23:26:23 +00:00
}
2020-02-22 23:26:23 +00:00
render() {
2020-03-07 04:53:28 +00:00
const {
intl,
2020-04-22 06:00:11 +01:00
isFeatured,
isPromoted,
2020-04-08 02:06:59 +01:00
isChild,
2020-04-22 06:00:11 +01:00
isHidden,
2020-05-14 07:03:22 +01:00
isNotification,
2020-04-22 06:00:11 +01:00
descendantsIds,
commentsLimited,
2020-05-05 06:16:01 +01:00
ancestorStatus,
isComment,
2020-05-06 05:33:54 +01:00
contextType,
2020-05-07 00:40:54 +01:00
isComposeModalOpen,
commentSortingType,
2020-03-07 04:53:28 +00:00
} = this.props
2020-05-06 05:33:54 +01:00
// const { height } = this.state
2020-05-01 06:50:27 +01:00
let { status } = this.props
2020-03-07 04:53:28 +00:00
2020-04-22 06:00:11 +01:00
if (!status) return null
2020-04-02 04:17:21 +01:00
2020-05-06 05:33:54 +01:00
if (isComment && !ancestorStatus && !isChild) {
2020-05-15 03:31:24 +01:00
// Wait to load...
// return <StatusPlaceholder />
if (contextType === 'feature') {
return <ColumnIndicator type='loading' />
}
2020-05-15 03:31:24 +01:00
return null
2020-05-06 05:33:54 +01:00
}
2020-05-02 07:25:55 +01:00
let reblogContent, rebloggedByText = null
2020-04-02 04:17:21 +01:00
2020-05-05 06:16:01 +01:00
if (ancestorStatus) {
status = ancestorStatus
} else {
if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') {
rebloggedByText = intl.formatMessage(
{ id: 'status.reposted_by', defaultMessage: '{name} reposted' },
{ name: status.getIn(['account', 'acct']) }
)
reblogContent = status.get('contentHtml')
status = status.get('reblog')
}
2020-04-22 06:00:11 +01:00
}
2020-02-14 00:40:04 +00:00
let sortByTitle = intl.formatMessage(messages.oldest)
if (commentSortingType === COMMENT_SORTING_TYPE_NEWEST) {
sortByTitle = intl.formatMessage(messages.newest)
} else if (commentSortingType === COMMENT_SORTING_TYPE_TOP) {
sortByTitle = intl.formatMessage(messages.top)
}
2020-04-23 07:13:29 +01:00
const handlers = (this.props.isMuted || isChild) ? {} : {
2020-04-22 06:00:11 +01:00
reply: this.handleHotkeyReply,
favorite: this.handleHotkeyFavorite,
repost: this.handleHotkeyRepost,
mention: this.handleHotkeyMention,
open: this.handleHotkeyOpen,
openProfile: this.handleHotkeyOpenProfile,
moveUp: this.handleHotkeyMoveUp,
moveDown: this.handleHotkeyMoveDown,
toggleHidden: this.handleHotkeyToggleHidden,
toggleSensitive: this.handleHotkeyToggleSensitive,
}
const parentClasses = CX({
pb15: !isChild,
2020-05-06 05:33:54 +01:00
})
const containerClasses = CX({
2020-05-14 21:45:39 +01:00
default: 1,
radiusSmall: !isChild,
2020-04-29 23:32:49 +01:00
bgPrimary: !isChild,
boxShadowBlock: !isChild,
2020-02-28 15:20:47 +00:00
})
const containerClassesXS = CX({
2020-05-07 00:40:54 +01:00
default: 1,
2020-05-06 05:33:54 +01:00
bgPrimary: !isChild,
boxShadowBlock: !isChild,
2020-05-07 00:40:54 +01:00
borderTop1PX: !isChild,
borderColorSecondary: !isChild,
2020-05-06 05:33:54 +01:00
})
const innerContainerClasses = CX({
2020-03-08 23:02:28 +00:00
default: 1,
overflowHidden: 1,
2020-04-17 06:35:46 +01:00
radiusSmall: isChild,
borderColorSecondary: isChild,
border1PX: isChild,
2020-05-14 07:03:22 +01:00
pb10: isChild && status.get('media_attachments').size === 0 && !isNotification,
pb5: isChild && status.get('media_attachments').size > 1 && !isNotification,
2020-04-02 04:17:21 +01:00
cursorPointer: isChild,
2020-04-29 23:32:49 +01:00
bgSubtle_onHover: isChild,
2020-03-08 23:02:28 +00:00
})
2020-05-06 05:33:54 +01:00
if (status.get('filtered') || status.getIn(['reblog', 'filtered'])) {
return null
}
if (isHidden) {
return (
<HotKeys handlers={handlers}>
<div ref={this.handleRef} className={parentClasses} tabIndex='0'>
{status.getIn(['account', 'display_name']) || status.getIn(['account', 'username'])}
{status.get('content')}
</div>
</HotKeys>
)
}
return (
<HotKeys handlers={handlers} className={_s.outlineNone}>
2020-05-06 05:33:54 +01:00
<div className={parentClasses}>
<ResponsiveClassesComponent
classNames={containerClasses}
classNamesXS={containerClassesXS}
>
<div
className={[_s.default, _s.outlineNone].join(' ')}
tabIndex={this.props.isMuted ? null : 0}
data-featured={isFeatured ? 'true' : null}
aria-label={textForScreenReader(intl, status, rebloggedByText)}
ref={this.handleRef}
onClick={isChild && !isNotification ? this.handleClick : undefined}
2020-05-06 05:33:54 +01:00
>
<div className={innerContainerClasses}>
<div data-id={status.get('id')}>
<StatusPrepend
status={this.props.status}
isPromoted={isPromoted}
isFeatured={isFeatured}
isComment={isComment && !isChild}
/>
2020-05-07 00:40:54 +01:00
<StatusHeader
status={status}
reduced={isChild}
/>
2020-05-06 05:33:54 +01:00
<div className={_s.default}>
<StatusContent
status={status}
reblogContent={reblogContent}
onClick={this.handleClick}
expanded={!status.get('hidden')}
onExpandedToggle={this.handleExpandedToggle}
collapsable={contextType !== 'feature'}
/>
</div>
<StatusMedia
isChild={isChild}
2020-05-07 00:40:54 +01:00
isComposeModalOpen={isComposeModalOpen}
2020-05-06 05:33:54 +01:00
status={status}
onOpenMedia={this.props.onOpenMedia}
cacheWidth={this.props.cacheMediaWidth}
defaultWidth={this.props.cachedMediaWidth}
visible={this.state.showMedia}
onToggleVisibility={this.handleToggleMediaVisibility}
width={this.props.cachedMediaWidth}
onOpenVideo={this.handleOpenVideo}
/>
{
(!!status.get('quote') || status.get('has_quote')) && !isChild &&
2020-05-06 05:33:54 +01:00
<div className={[_s.default, _s.mt10, _s.px10].join(' ')}>
{
!!status.get('quoted_status') &&
<Status status={status.get('quoted_status')} isChild intl={intl} />
}
{
!status.get('quoted_status') &&
<div className={[_s.default, _s.border1PX, _s.bgSubtle, _s.radiusSmall, _s.py15, _s.px15, _s.borderColorSecondary].join(' ')}>
<Text color='tertiary' size='medium'>The quoted gab is unavailable.</Text>
</div>
}
2020-05-06 05:33:54 +01:00
</div>
}
{
2020-05-14 07:03:22 +01:00
(!isChild || isNotification) &&
2020-05-06 05:33:54 +01:00
<StatusActionBar
status={status}
onFavorite={this.props.onFavorite}
2020-05-15 04:17:31 +01:00
onReply={this.handleOnReply}
2020-05-06 05:33:54 +01:00
onRepost={this.props.onRepost}
onShare={this.props.onShare}
onOpenLikes={this.props.onOpenLikes}
onOpenReposts={this.props.onOpenReposts}
onQuote={this.handleOnQuote}
2020-05-06 05:33:54 +01:00
/>
}
{
!isChild && !!me &&
2020-05-09 03:17:19 +01:00
<ResponsiveClassesComponent
classNames={[_s.default, _s.borderTop1PX, _s.borderColorSecondary, _s.pt10, _s.px15, _s.mb10].join(' ')}
classNamesXS={[_s.default, _s.borderTop1PX, _s.borderColorSecondary, _s.pt10, _s.px10, _s.mb10].join(' ')}
>
2020-05-06 05:33:54 +01:00
<ComposeFormContainer replyToId={status.get('id')} shouldCondense />
2020-05-09 03:17:19 +01:00
</ResponsiveClassesComponent>
2020-05-06 05:33:54 +01:00
}
{
status.get('replies_count') > 0 && !isChild && !isNotification && !commentsLimited &&
<Fragment>
<div className={[_s.default, _s.mr10, _s.ml10, _s.mb10, _s.borderColorSecondary, _s.borderBottom1PX].join(' ')} />
<SortBlock
value={sortByTitle}
onClickValue={this.handleOnCommentSortOpen}
/>
{
descendantsIds.size === 0 &&
<Fragment>
<CommentPlaceholder />
<CommentPlaceholder />
<CommentPlaceholder />
</Fragment>
}
{
descendantsIds.size > 0 &&
<CommentList
ancestorAccountId={status.getIn(['account', 'id'])}
commentsLimited={commentsLimited}
descendants={descendantsIds}
onViewComments={this.handleClick}
/>
}
</Fragment>
2020-05-06 05:33:54 +01:00
}
2020-04-02 04:17:21 +01:00
</div>
2020-05-06 05:33:54 +01:00
</div>
2020-02-22 23:26:23 +00:00
</div>
2020-05-06 05:33:54 +01:00
</ResponsiveClassesComponent>
</div>
</HotKeys>
2020-04-22 06:00:11 +01:00
)
}
}