Skip to content

Commit

Permalink
Reduce differences with upstream in Account component
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire committed Nov 20, 2023
1 parent fcc62d3 commit 261545b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 47 deletions.
36 changes: 4 additions & 32 deletions app/javascript/flavours/glitch/components/account.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { RelativeTimestamp } from './relative_timestamp';
const messages = defineMessages({
follow: { id: 'account.follow', defaultMessage: 'Follow' },
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}' },
unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' },
mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'Mute notifications from @{name}' },
Expand All @@ -38,7 +38,6 @@ class Account extends ImmutablePureComponent {
onMuteNotifications: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
hidden: PropTypes.bool,
small: PropTypes.bool,
actionIcon: PropTypes.string,
actionTitle: PropTypes.string,
defaultAction: PropTypes.string,
Expand Down Expand Up @@ -74,17 +73,7 @@ class Account extends ImmutablePureComponent {
};

render () {
const {
account,
hidden,
intl,
small,
onActionClick,
actionIcon,
actionTitle,
defaultAction,
size,
} = this.props;
const { account, intl, hidden, onActionClick, actionIcon, actionTitle, defaultAction, size } = this.props;

if (!account) {
return (
Expand Down Expand Up @@ -114,7 +103,7 @@ class Account extends ImmutablePureComponent {
if (actionIcon) {
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 requested = account.getIn(['relationship', 'requested']);
const blocking = account.getIn(['relationship', 'blocking']);
Expand Down Expand Up @@ -151,24 +140,7 @@ class Account extends ImmutablePureComponent {
mute_expires_at = <div><RelativeTimestamp timestamp={account.get('mute_expires_at')} futureDate /></div>;
}

return small ? (
<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>
) : (
return (
<div className='account'>
<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')}`}>
Expand Down
15 changes: 0 additions & 15 deletions app/javascript/flavours/glitch/styles/components/accounts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@
-webkit-box-orient: vertical;
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 {
Expand Down

0 comments on commit 261545b

Please sign in to comment.