Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
Ember-ruby committed Jun 30, 2024
1 parent a7a4088 commit f5acbbd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/javascript/flavours/blobfox/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ class Status extends ImmutablePureComponent {
extraMedia={extraMedia}
mediaIcons={contentMediaIcons}
expanded={isExpanded}
collapsed={collapsed}
collapsed={isCollapsed}
toggleCollapse={this.handleHotkeyCollapse}
onExpandedToggle={this.handleExpandedToggle}
onTranslate={this.handleTranslate}
Expand Down
18 changes: 4 additions & 14 deletions app/javascript/flavours/blobfox/components/status_content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class StatusContent extends PureComponent {
status: ImmutablePropTypes.map.isRequired,
statusContent: PropTypes.string,
expanded: PropTypes.bool,
collapsed: PropTypes.bool,
onExpandedToggle: PropTypes.func,
onTranslate: PropTypes.func,
media: PropTypes.node,
Expand All @@ -155,18 +156,8 @@ class StatusContent extends PureComponent {

state = {
hidden: true,
collapsed: false,
};

updateOnProps = [
'settings',
'muted',
];

updateOnStates = [
'collapsed',
];

_updateStatusLinks () {
const node = this.contentsNode;
const { tagLinks, rewriteMentions } = this.props;
Expand Down Expand Up @@ -342,6 +333,7 @@ class StatusContent extends PureComponent {
media,
extraMedia,
mediaIcons,
collapsed,
muted,
settings,
parseClick,
Expand All @@ -352,8 +344,6 @@ class StatusContent extends PureComponent {
statusContent,
} = this.props;

const collapsed = this.props.toggleCollapse ? this.props.collapsed : this.state.collapsed;

const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden;
const contentLocale = intl.locale.replace(/[_-].*/, '');
const targetLanguages = this.props.languages?.get(status.get('language') || 'und');
Expand Down Expand Up @@ -434,7 +424,7 @@ class StatusContent extends PureComponent {
}

return (
<div className={classNames} tabIndex={0} onMouseDown={this.handleMouseDown} onMouseUp={this.handleMouseUp} style={isCollapsed ? { height: `${collapsedHeight}px` } : null}>
<div className={classNames} tabIndex={0} onMouseDown={this.handleMouseDown} onMouseUp={this.handleMouseUp} style={collapsed ? { height: `${collapsedHeight}px` } : null}>
<p
style={{ marginBottom: hidden && status.get('mentions').isEmpty() ? '0px' : null }}
>
Expand Down Expand Up @@ -472,7 +462,7 @@ class StatusContent extends PureComponent {
onMouseDown={this.handleMouseDown}
onMouseUp={this.handleMouseUp}
tabIndex={0}
style={isCollapsed ? { height: `${collapsedHeight}px` } : null}
style={collapsed ? { height: `${collapsedHeight}px` } : null}
>
<div
ref={this.setContentsRef}
Expand Down

0 comments on commit f5acbbd

Please sign in to comment.