Skip to content

Commit

Permalink
Change: #273 投稿下のアクションバーについて、スタンプボタンを消すとき他のボタンで詰めない (#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmycode authored Dec 26, 2023
1 parent dc6e605 commit b94ffe6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
11 changes: 6 additions & 5 deletions app/javascript/mastodon/components/status_action_bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -468,11 +468,12 @@ class StatusActionBar extends ImmutablePureComponent {
const mutual = emojiReactionPolicy !== 'mutuals_only' || (relationship && relationship.get('following') && relationship.get('followed_by'));
const outside = emojiReactionPolicy !== 'outside_only' || (relationship && (relationship.get('following') || relationship.get('followed_by')));
const denyFromAll = emojiReactionPolicy !== 'block' && emojiReactionPolicy !== 'block';
const emojiPickerButton = (
<IconButton className='status__action-bar__button' title={intl.formatMessage(messages.emojiReaction)} icon='smile-o' iconComponent={EmojiReactionIcon} onClick={this.handleEmojiPickInnerButton} />
);
const emojiPickerDropdown = enableEmojiReaction && emojiReactionAvailableServer && denyFromAll && (writtenByMe || (following && followed && mutual && outside)) && (
<EmojiPickerDropdown onPickEmoji={this.handleEmojiPick} button={emojiPickerButton} />
const emojiPickerDropdown = (enableEmojiReaction && emojiReactionAvailableServer && denyFromAll && (writtenByMe || (following && followed && mutual && outside)) && (
<EmojiPickerDropdown onPickEmoji={this.handleEmojiPick} button={(
<IconButton className='status__action-bar__button' title={intl.formatMessage(messages.emojiReaction)} icon='smile-o' iconComponent={EmojiReactionIcon} onClick={this.handleEmojiPickInnerButton} />
)} />
)) || (
<div className='status__action-bar__button__blank' />
);

const isReply = status.get('in_reply_to_account_id') === status.getIn(['account', 'id']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,14 @@ class ActionBar extends PureComponent {
const mutual = emojiReactionPolicy !== 'mutuals_only' || (relationship && relationship.get('following') && relationship.get('followed_by'));
const outside = emojiReactionPolicy !== 'outside_only' || (relationship && (relationship.get('following') || relationship.get('followed_by')));
const denyFromAll = emojiReactionPolicy !== 'block' && emojiReactionPolicy !== 'block';
const emojiPickerButton = (
<IconButton icon='smile-o' iconComponent={EmojiReactionIcon} onClick={this.handleEmojiPickInnerButton} title={intl.formatMessage(messages.pickEmoji)} />
);
const emojiPickerDropdown = enableEmojiReaction && emojiReactionAvailableServer && denyFromAll && (writtenByMe || (following && followed && mutual && outside)) && (
<div className='detailed-status__button'><EmojiPickerDropdown onPickEmoji={this.handleEmojiPick} button={emojiPickerButton} /></div>
const emojiPickerDropdown = (enableEmojiReaction && emojiReactionAvailableServer && denyFromAll && (writtenByMe || (following && followed && mutual && outside)) && (
<div className='detailed-status__button'>
<EmojiPickerDropdown onPickEmoji={this.handleEmojiPick} button={(
<IconButton title={intl.formatMessage(messages.pickEmoji)} icon='smile-o' iconComponent={EmojiReactionIcon} onClick={this.handleEmojiPickInnerButton} />
)} />
</div>
)) || (
<div className='detailed-status__button__blank' />
);

return (
Expand Down
9 changes: 9 additions & 0 deletions app/javascript/styles/mastodon/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,10 @@ body > [data-popper-placement] {
align-items: center;
gap: 18px;
margin-top: 16px;

&__button__blank {
width: 24px;
}
}

.detailed-status__action-bar-dropdown {
Expand Down Expand Up @@ -1442,6 +1446,11 @@ body > [data-popper-placement] {
padding: 0;
margin-bottom: 16px;
}

&__button__blank {
width: 24px;
flex: 1 1 auto;
}
}

.scrollable > div:first-child .detailed-status {
Expand Down

0 comments on commit b94ffe6

Please sign in to comment.