Reduce differences with upstream in `Account` component
parent
9ab1aa15e9
commit
f00fcda785
|
@ -18,7 +18,7 @@ import { RelativeTimestamp } from './relative_timestamp';
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
follow: { id: 'account.follow', defaultMessage: 'Follow' },
|
follow: { id: 'account.follow', defaultMessage: 'Follow' },
|
||||||
unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' },
|
unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' },
|
||||||
requested: { id: 'account.requested', defaultMessage: 'Awaiting approval. Click to cancel follow request' },
|
requested: { id: 'account.requested', defaultMessage: 'Awaiting approval' },
|
||||||
unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },
|
unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },
|
||||||
unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' },
|
unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' },
|
||||||
mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'Mute notifications from @{name}' },
|
mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'Mute notifications from @{name}' },
|
||||||
|
@ -38,7 +38,6 @@ class Account extends ImmutablePureComponent {
|
||||||
onMuteNotifications: PropTypes.func.isRequired,
|
onMuteNotifications: PropTypes.func.isRequired,
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
hidden: PropTypes.bool,
|
hidden: PropTypes.bool,
|
||||||
small: PropTypes.bool,
|
|
||||||
actionIcon: PropTypes.string,
|
actionIcon: PropTypes.string,
|
||||||
actionTitle: PropTypes.string,
|
actionTitle: PropTypes.string,
|
||||||
defaultAction: PropTypes.string,
|
defaultAction: PropTypes.string,
|
||||||
|
@ -74,17 +73,7 @@ class Account extends ImmutablePureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const {
|
const { account, intl, hidden, onActionClick, actionIcon, actionTitle, defaultAction, size } = this.props;
|
||||||
account,
|
|
||||||
hidden,
|
|
||||||
intl,
|
|
||||||
small,
|
|
||||||
onActionClick,
|
|
||||||
actionIcon,
|
|
||||||
actionTitle,
|
|
||||||
defaultAction,
|
|
||||||
size,
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
if (!account) {
|
if (!account) {
|
||||||
return (
|
return (
|
||||||
|
@ -114,7 +103,7 @@ class Account extends ImmutablePureComponent {
|
||||||
if (actionIcon) {
|
if (actionIcon) {
|
||||||
buttons = <IconButton icon={actionIcon} title={actionTitle} onClick={this.handleAction} />;
|
buttons = <IconButton icon={actionIcon} title={actionTitle} onClick={this.handleAction} />;
|
||||||
}
|
}
|
||||||
} else if (account.get('id') !== me && !small && account.get('relationship', null) !== null) {
|
} else if (account.get('id') !== me && account.get('relationship', null) !== null) {
|
||||||
const following = account.getIn(['relationship', 'following']);
|
const following = account.getIn(['relationship', 'following']);
|
||||||
const requested = account.getIn(['relationship', 'requested']);
|
const requested = account.getIn(['relationship', 'requested']);
|
||||||
const blocking = account.getIn(['relationship', 'blocking']);
|
const blocking = account.getIn(['relationship', 'blocking']);
|
||||||
|
@ -151,24 +140,7 @@ class Account extends ImmutablePureComponent {
|
||||||
mute_expires_at = <div><RelativeTimestamp timestamp={account.get('mute_expires_at')} futureDate /></div>;
|
mute_expires_at = <div><RelativeTimestamp timestamp={account.get('mute_expires_at')} futureDate /></div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
return small ? (
|
return (
|
||||||
<Permalink
|
|
||||||
className='account small'
|
|
||||||
href={account.get('url')}
|
|
||||||
to={`/@${account.get('acct')}`}
|
|
||||||
>
|
|
||||||
<div className='account__avatar-wrapper'>
|
|
||||||
<Avatar
|
|
||||||
account={account}
|
|
||||||
size={24}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<DisplayName
|
|
||||||
account={account}
|
|
||||||
inline
|
|
||||||
/>
|
|
||||||
</Permalink>
|
|
||||||
) : (
|
|
||||||
<div className='account'>
|
<div className='account'>
|
||||||
<div className='account__wrapper'>
|
<div className='account__wrapper'>
|
||||||
<Permalink key={account.get('id')} className='account__display-name' title={account.get('acct')} href={account.get('url')} to={`/@${account.get('acct')}`}>
|
<Permalink key={account.get('id')} className='account__display-name' title={account.get('acct')} href={account.get('url')} to={`/@${account.get('acct')}`}>
|
||||||
|
|
|
@ -27,21 +27,6 @@
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
color: $ui-secondary-color;
|
color: $ui-secondary-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.small {
|
|
||||||
border: 0;
|
|
||||||
padding: 0;
|
|
||||||
|
|
||||||
& > .account__avatar-wrapper {
|
|
||||||
margin: 0;
|
|
||||||
margin-inline-end: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
& > .display-name {
|
|
||||||
height: 24px;
|
|
||||||
line-height: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.follow-recommendations-account {
|
.follow-recommendations-account {
|
||||||
|
|
Loading…
Reference in New Issue