Refactor bot badge

This commit is contained in:
Sean King 2021-01-18 11:55:38 -07:00
parent bebe50cc33
commit fe8eecf925
No known key found for this signature in database
GPG key ID: 510C52BACD6E7257
4 changed files with 14 additions and 23 deletions

View file

@ -17,6 +17,7 @@ const messages = defineMessages({
linkVerifiedOn: { id: 'account.link_verified_on', defaultMessage: 'Ownership of this link was checked on {date}' }, linkVerifiedOn: { id: 'account.link_verified_on', defaultMessage: 'Ownership of this link was checked on {date}' },
account_locked: { id: 'account.locked_info', defaultMessage: 'This account privacy status is set to locked. The owner manually reviews who can follow them.' }, account_locked: { id: 'account.locked_info', defaultMessage: 'This account privacy status is set to locked. The owner manually reviews who can follow them.' },
deactivated: { id: 'account.deactivated', defaultMessage: 'Deactivated' }, deactivated: { id: 'account.deactivated', defaultMessage: 'Deactivated' },
bot: { id: 'account.badges.bot', defaultMessage: 'Bot' },
}); });
const dateFormatOptions = { const dateFormatOptions = {
@ -56,7 +57,6 @@ class ProfileInfoPanel extends ImmutablePureComponent {
} }
const lockedIcon = account.get('locked') ? (<Icon id='lock' title={intl.formatMessage(messages.account_locked)} />) : ''; const lockedIcon = account.get('locked') ? (<Icon id='lock' title={intl.formatMessage(messages.account_locked)} />) : '';
const badge = account.get('bot') ? (<div className='account-role bot'><FormattedMessage id='account.badges.bot' defaultMessage='Bot' /></div>) : null;
const content = { __html: account.get('note_emojified') }; const content = { __html: account.get('note_emojified') };
const fields = account.get('fields'); const fields = account.get('fields');
const deactivated = account.getIn(['pleroma', 'deactivated'], false); const deactivated = account.getIn(['pleroma', 'deactivated'], false);
@ -72,7 +72,7 @@ class ProfileInfoPanel extends ImmutablePureComponent {
<h1> <h1>
<span dangerouslySetInnerHTML={displayNameHtml} className='profile-info-panel__name-content' /> <span dangerouslySetInnerHTML={displayNameHtml} className='profile-info-panel__name-content' />
{verified && <VerificationBadge />} {verified && <VerificationBadge />}
{badge} {account.get('bot') && <Badge slug='bot' title={intl.formatMessage(messages.bot)} />}
{ <small>@{acctFull(account)} {lockedIcon}</small> } { <small>@{acctFull(account)} {lockedIcon}</small> }
</h1> </h1>
</div> </div>

View file

@ -177,23 +177,6 @@
} }
} }
.account-role {
display: inline-block;
padding: 4px 6px;
cursor: default;
border-radius: 3px;
font-size: 12px;
line-height: 12px;
font-weight: 500;
color: var(--primary-text-color);
background-color: hsla(var(--primary-text-color_hsl), 0.1);
border: 1px solid hsla(var(--primary-text-color_hsl), 0.5);
&.bot {
margin-left: 5px;
}
}
.account { .account {
padding: 10px; padding: 10px;
position: relative; position: relative;

View file

@ -22,4 +22,16 @@
background-color: #048ba8; background-color: #048ba8;
color: #fff; color: #fff;
} }
&--bot {
margin-left: 5px;
color: var(--primary-text-color);
background-color: hsla(var(--primary-text-color_hsl), 0.1);
border: 1px solid hsla(var(--primary-text-color_hsl), 0.5);
text-transform: none;
padding: 4px 6px;
vertical-align: top;
display: inline-block;
line-height: 12px;
}
} }

View file

@ -40,10 +40,6 @@
&__name { &__name {
display: block; display: block;
.account-role {
vertical-align: top;
}
.emojione { .emojione {
width: 22px; width: 22px;
height: 22px; height: 22px;