Add icons for private and disabled boost in web UI (#27817)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
		
					parent
					
						
							
								a36b59be8a
							
						
					
				
			
			
				commit
				
					
						7e3c10dec6
					
				
			
		
					 5 changed files with 31 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -19,6 +19,8 @@ import { ReactComponent as StarIcon } from '@material-symbols/svg-600/outlined/s
 | 
			
		|||
import { ReactComponent as StarBorderIcon } from '@material-symbols/svg-600/outlined/star.svg';
 | 
			
		||||
import { ReactComponent as VisibilityIcon } from '@material-symbols/svg-600/outlined/visibility.svg';
 | 
			
		||||
 | 
			
		||||
import { ReactComponent as RepeatDisabledIcon } from 'mastodon/../svg-icons/repeat_disabled.svg';
 | 
			
		||||
import { ReactComponent as RepeatPrivateIcon } from 'mastodon/../svg-icons/repeat_private.svg';
 | 
			
		||||
import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'mastodon/permissions';
 | 
			
		||||
import { WithRouterPropTypes } from 'mastodon/utils/react_router';
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -348,6 +350,7 @@ class StatusActionBar extends ImmutablePureComponent {
 | 
			
		|||
    let replyIcon;
 | 
			
		||||
    let replyIconComponent;
 | 
			
		||||
    let replyTitle;
 | 
			
		||||
 | 
			
		||||
    if (status.get('in_reply_to_id', null) === null) {
 | 
			
		||||
      replyIcon = 'reply';
 | 
			
		||||
      replyIconComponent = ReplyIcon;
 | 
			
		||||
| 
						 | 
				
			
			@ -360,15 +363,20 @@ class StatusActionBar extends ImmutablePureComponent {
 | 
			
		|||
 | 
			
		||||
    const reblogPrivate = status.getIn(['account', 'id']) === me && status.get('visibility') === 'private';
 | 
			
		||||
 | 
			
		||||
    let reblogTitle = '';
 | 
			
		||||
    let reblogTitle, reblogIconComponent;
 | 
			
		||||
 | 
			
		||||
    if (status.get('reblogged')) {
 | 
			
		||||
      reblogTitle = intl.formatMessage(messages.cancel_reblog_private);
 | 
			
		||||
      reblogIconComponent = publicStatus ? RepeatIcon : RepeatPrivateIcon;
 | 
			
		||||
    } else if (publicStatus) {
 | 
			
		||||
      reblogTitle = intl.formatMessage(messages.reblog);
 | 
			
		||||
      reblogIconComponent = RepeatIcon;
 | 
			
		||||
    } else if (reblogPrivate) {
 | 
			
		||||
      reblogTitle = intl.formatMessage(messages.reblog_private);
 | 
			
		||||
      reblogIconComponent = RepeatPrivateIcon;
 | 
			
		||||
    } else {
 | 
			
		||||
      reblogTitle = intl.formatMessage(messages.cannot_reblog);
 | 
			
		||||
      reblogIconComponent = RepeatDisabledIcon;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const filterButton = this.props.onFilter && (
 | 
			
		||||
| 
						 | 
				
			
			@ -380,7 +388,7 @@ class StatusActionBar extends ImmutablePureComponent {
 | 
			
		|||
    return (
 | 
			
		||||
      <div className='status__action-bar'>
 | 
			
		||||
        <IconButton className='status__action-bar__button' title={replyTitle} icon={isReply ? 'reply' : replyIcon} iconComponent={isReply ? ReplyIcon : replyIconComponent} onClick={this.handleReplyClick} counter={status.get('replies_count')} />
 | 
			
		||||
        <IconButton className={classNames('status__action-bar__button', { reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} title={reblogTitle} icon='retweet' iconComponent={RepeatIcon} onClick={this.handleReblogClick} counter={withCounters ? status.get('reblogs_count') : undefined} />
 | 
			
		||||
        <IconButton className={classNames('status__action-bar__button', { reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} title={reblogTitle} icon='retweet' iconComponent={reblogIconComponent} onClick={this.handleReblogClick} counter={withCounters ? status.get('reblogs_count') : undefined} />
 | 
			
		||||
        <IconButton className='status__action-bar__button star-icon' animate active={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' iconComponent={status.get('favourited') ? StarIcon : StarBorderIcon} onClick={this.handleFavouriteClick} counter={withCounters ? status.get('favourites_count') : undefined} />
 | 
			
		||||
        <IconButton className='status__action-bar__button bookmark-icon' disabled={!signedIn} active={status.get('bookmarked')} title={intl.formatMessage(messages.bookmark)} icon='bookmark' iconComponent={status.get('bookmarked') ? BookmarkIcon : BookmarkBorderIcon} onClick={this.handleBookmarkClick} />
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue