revert changes to action bar

This commit is contained in:
Sebastian Jambor 2023-04-18 21:47:23 +02:00
parent 6fdeba6119
commit 16d01476d5

View file

@ -7,38 +7,22 @@ import { defineMessages, injectIntl } from 'react-intl';
const messages = defineMessages({ const messages = defineMessages({
edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' }, edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },
pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned posts' }, pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned posts' },
preferences: { preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },
id: 'navigation_bar.preferences', follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },
defaultMessage: 'Preferences',
},
follow_requests: {
id: 'navigation_bar.follow_requests',
defaultMessage: 'Follow requests',
},
activity_log: {
id: 'navigation_bar.activity_log',
defaultMessage: 'Activity log',
},
favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' }, favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' },
lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' }, lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' },
followed_tags: { followed_tags: { id: 'navigation_bar.followed_tags', defaultMessage: 'Followed hashtags' },
id: 'navigation_bar.followed_tags',
defaultMessage: 'Followed hashtags',
},
blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' }, blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },
domain_blocks: { domain_blocks: { id: 'navigation_bar.domain_blocks', defaultMessage: 'Hidden domains' },
id: 'navigation_bar.domain_blocks',
defaultMessage: 'Hidden domains',
},
mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' }, mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },
filters: { id: 'navigation_bar.filters', defaultMessage: 'Muted words' }, filters: { id: 'navigation_bar.filters', defaultMessage: 'Muted words' },
logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' }, logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' },
bookmarks: { id: 'navigation_bar.bookmarks', defaultMessage: 'Bookmarks' }, bookmarks: { id: 'navigation_bar.bookmarks', defaultMessage: 'Bookmarks' },
}); });
export default export default @injectIntl
@injectIntl
class ActionBar extends React.PureComponent { class ActionBar extends React.PureComponent {
static propTypes = { static propTypes = {
account: ImmutablePropTypes.map.isRequired, account: ImmutablePropTypes.map.isRequired,
onLogout: PropTypes.func.isRequired, onLogout: PropTypes.func.isRequired,
@ -49,67 +33,35 @@ class ActionBar extends React.PureComponent {
this.props.onLogout(); this.props.onLogout();
}; };
render() { render () {
const { intl } = this.props; const { intl } = this.props;
let menu = []; let menu = [];
menu.push({ menu.push({ text: intl.formatMessage(messages.edit_profile), href: '/settings/profile' });
text: intl.formatMessage(messages.edit_profile), menu.push({ text: intl.formatMessage(messages.preferences), href: '/settings/preferences' });
href: '/settings/profile',
});
menu.push({
text: intl.formatMessage(messages.preferences),
href: '/settings/preferences',
});
menu.push({ text: intl.formatMessage(messages.pins), to: '/pinned' }); menu.push({ text: intl.formatMessage(messages.pins), to: '/pinned' });
menu.push(null); menu.push(null);
menu.push({ menu.push({ text: intl.formatMessage(messages.follow_requests), to: '/follow_requests' });
text: intl.formatMessage(messages.follow_requests), menu.push({ text: intl.formatMessage(messages.favourites), to: '/favourites' });
to: '/follow_requests', menu.push({ text: intl.formatMessage(messages.bookmarks), to: '/bookmarks' });
});
menu.push({
text: intl.formatMessage(messages.favourites),
to: '/favourites',
});
menu.push({
text: intl.formatMessage(messages.bookmarks),
to: '/bookmarks',
});
menu.push({ text: intl.formatMessage(messages.lists), to: '/lists' }); menu.push({ text: intl.formatMessage(messages.lists), to: '/lists' });
menu.push({ menu.push({ text: intl.formatMessage(messages.followed_tags), to: '/followed_tags' });
text: intl.formatMessage(messages.followed_tags),
to: '/followed_tags',
});
menu.push({
text: intl.formatMessage(messages.activity_log),
to: '/activity_log',
});
menu.push(null); menu.push(null);
menu.push({ text: intl.formatMessage(messages.mutes), to: '/mutes' }); menu.push({ text: intl.formatMessage(messages.mutes), to: '/mutes' });
menu.push({ text: intl.formatMessage(messages.blocks), to: '/blocks' }); menu.push({ text: intl.formatMessage(messages.blocks), to: '/blocks' });
menu.push({ menu.push({ text: intl.formatMessage(messages.domain_blocks), to: '/domain_blocks' });
text: intl.formatMessage(messages.domain_blocks),
to: '/domain_blocks',
});
menu.push({ text: intl.formatMessage(messages.filters), href: '/filters' }); menu.push({ text: intl.formatMessage(messages.filters), href: '/filters' });
menu.push(null); menu.push(null);
menu.push({ menu.push({ text: intl.formatMessage(messages.logout), action: this.handleLogout });
text: intl.formatMessage(messages.logout),
action: this.handleLogout,
});
return ( return (
<div className="compose__action-bar"> <div className='compose__action-bar'>
<div className="compose__action-bar-dropdown"> <div className='compose__action-bar-dropdown'>
<DropdownMenuContainer <DropdownMenuContainer items={menu} icon='ellipsis-v' size={18} direction='right' />
items={menu}
icon="ellipsis-v"
size={18}
direction="right"
/>
</div> </div>
</div> </div>
); );
} }
} }