Change design of dropdowns in web UI (#25107)
This commit is contained in:
		@@ -121,10 +121,10 @@ class DropdownMenu extends PureComponent {
 | 
			
		||||
      return <li key={`sep-${i}`} className='dropdown-menu__separator' />;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const { text, href = '#', target = '_blank', method } = option;
 | 
			
		||||
    const { text, href = '#', target = '_blank', method, dangerous } = option;
 | 
			
		||||
 | 
			
		||||
    return (
 | 
			
		||||
      <li className='dropdown-menu__item' key={`${text}-${i}`}>
 | 
			
		||||
      <li className={classNames('dropdown-menu__item', { 'dropdown-menu__item--dangerous': dangerous })} key={`${text}-${i}`}>
 | 
			
		||||
        <a href={href} target={target} data-method={method} rel='noopener noreferrer' role='button' tabIndex={0} ref={i === 0 ? this.setFocusRef : null} onClick={this.handleClick} onKeyPress={this.handleItemKeyPress} data-index={i}>
 | 
			
		||||
          {text}
 | 
			
		||||
        </a>
 | 
			
		||||
 
 | 
			
		||||
@@ -280,8 +280,8 @@ class StatusActionBar extends ImmutablePureComponent {
 | 
			
		||||
 | 
			
		||||
    if (writtenByMe) {
 | 
			
		||||
      menu.push({ text: intl.formatMessage(messages.edit), action: this.handleEditClick });
 | 
			
		||||
      menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });
 | 
			
		||||
      menu.push({ text: intl.formatMessage(messages.redraft), action: this.handleRedraftClick });
 | 
			
		||||
      menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick, dangerous: true });
 | 
			
		||||
      menu.push({ text: intl.formatMessage(messages.redraft), action: this.handleRedraftClick, dangerous: true });
 | 
			
		||||
    } else {
 | 
			
		||||
      menu.push({ text: intl.formatMessage(messages.mention, { name: account.get('username') }), action: this.handleMentionClick });
 | 
			
		||||
      menu.push({ text: intl.formatMessage(messages.direct, { name: account.get('username') }), action: this.handleDirectClick });
 | 
			
		||||
@@ -290,22 +290,22 @@ class StatusActionBar extends ImmutablePureComponent {
 | 
			
		||||
      if (relationship && relationship.get('muting')) {
 | 
			
		||||
        menu.push({ text: intl.formatMessage(messages.unmute, { name: account.get('username') }), action: this.handleMuteClick });
 | 
			
		||||
      } else {
 | 
			
		||||
        menu.push({ text: intl.formatMessage(messages.mute, { name: account.get('username') }), action: this.handleMuteClick });
 | 
			
		||||
        menu.push({ text: intl.formatMessage(messages.mute, { name: account.get('username') }), action: this.handleMuteClick, dangerous: true });
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (relationship && relationship.get('blocking')) {
 | 
			
		||||
        menu.push({ text: intl.formatMessage(messages.unblock, { name: account.get('username') }), action: this.handleBlockClick });
 | 
			
		||||
      } else {
 | 
			
		||||
        menu.push({ text: intl.formatMessage(messages.block, { name: account.get('username') }), action: this.handleBlockClick });
 | 
			
		||||
        menu.push({ text: intl.formatMessage(messages.block, { name: account.get('username') }), action: this.handleBlockClick, dangerous: true });
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (!this.props.onFilter) {
 | 
			
		||||
        menu.push(null);
 | 
			
		||||
        menu.push({ text: intl.formatMessage(messages.filter), action: this.handleFilterClick });
 | 
			
		||||
        menu.push({ text: intl.formatMessage(messages.filter), action: this.handleFilterClick, dangerous: true });
 | 
			
		||||
        menu.push(null);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      menu.push({ text: intl.formatMessage(messages.report, { name: account.get('username') }), action: this.handleReport });
 | 
			
		||||
      menu.push({ text: intl.formatMessage(messages.report, { name: account.get('username') }), action: this.handleReport, dangerous: true });
 | 
			
		||||
 | 
			
		||||
      if (account.get('acct') !== account.get('username')) {
 | 
			
		||||
        const domain = account.get('acct').split('@')[1];
 | 
			
		||||
@@ -315,7 +315,7 @@ class StatusActionBar extends ImmutablePureComponent {
 | 
			
		||||
        if (relationship && relationship.get('domain_blocking')) {
 | 
			
		||||
          menu.push({ text: intl.formatMessage(messages.unblockDomain, { domain }), action: this.handleUnblockDomain });
 | 
			
		||||
        } else {
 | 
			
		||||
          menu.push({ text: intl.formatMessage(messages.blockDomain, { domain }), action: this.handleBlockDomain });
 | 
			
		||||
          menu.push({ text: intl.formatMessage(messages.blockDomain, { domain }), action: this.handleBlockDomain, dangerous: true });
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user