Skip to content

Commit

Permalink
?
Browse files Browse the repository at this point in the history
  • Loading branch information
Ember-ruby committed Jun 30, 2024
1 parent a6f7bac commit 7a88232
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
11 changes: 1 addition & 10 deletions app/javascript/flavours/blobfox/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,6 @@ class Status extends ImmutablePureComponent {
} = this.props;
const { isCollapsed } = this.state;
let background = null;
let collapsedHeight = null;
let attachments = null;

// Depending on user settings, some media are considered as parts of the
Expand Down Expand Up @@ -637,14 +636,6 @@ class Status extends ImmutablePureComponent {
background = status.getIn(['account', 'header']);
}

collapsedHeight = (
settings.getIn(['collapsed', 'auto', 'height'])
)

if (status.get('media_attachments').size && !muted) {
collapsedHeight += 210;
}

// This handles our media attachments.
// If a media file is of unknwon type or if the status is muted
// (notification), we show a list of links instead of embedded media.
Expand Down Expand Up @@ -855,11 +846,11 @@ class Status extends ImmutablePureComponent {
</header>
<StatusContent
status={status}
style={isCollapsed ? { height: `${collapsedHeight}px` } : null}
media={contentMedia}
extraMedia={extraMedia}
mediaIcons={contentMediaIcons}
expanded={isExpanded}
collapsed={isCollapsed}
onExpandedToggle={this.handleExpandedToggle}
onTranslate={this.handleTranslate}
parseClick={parseClick}
Expand Down
16 changes: 15 additions & 1 deletion app/javascript/flavours/blobfox/components/status_content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ class StatusContent extends PureComponent {
media,
extraMedia,
mediaIcons,
collapsed,
settings,
parseClick,
disabled,
tagLinks,
Expand All @@ -357,6 +359,16 @@ class StatusContent extends PureComponent {
<TranslateButton onClick={this.handleTranslate} translation={status.get('translation')} />
);

let collapsedHeight = null;

collapsedHeight = (
settings.getIn(['collapsed', 'auto', 'height'])
)

if (status.get('media_attachments').size && !muted) {
collapsedHeight += 210;
}

if (status.get('spoiler_text').length > 0) {
let mentionsPlaceholder = '';

Expand Down Expand Up @@ -408,7 +420,7 @@ class StatusContent extends PureComponent {
}

return (
<div className={classNames} tabIndex={0} onMouseDown={this.handleMouseDown} onMouseUp={this.handleMouseUp}>
<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 @@ -446,6 +458,7 @@ class StatusContent extends PureComponent {
onMouseDown={this.handleMouseDown}
onMouseUp={this.handleMouseUp}
tabIndex={0}
style={collapsed ? { height: `${collapsedHeight}px` } : null}
>
<div
ref={this.setContentsRef}
Expand All @@ -467,6 +480,7 @@ class StatusContent extends PureComponent {
<div
className='status__content'
tabIndex={0}
style={collapsed ? { height: `${collapsedHeight}px` } : null}
>
<div
ref={this.setContentsRef}
Expand Down

0 comments on commit 7a88232

Please sign in to comment.