sforkowany z mirror/soapbox
Put Bookmarks and Lists behind feature flags
rodzic
be8f3d9e64
commit
074604a1c9
|
@ -218,14 +218,14 @@ class SidebarMenu extends ImmutablePureComponent {
|
|||
<Icon id='bitcoin' />
|
||||
<span className='sidebar-menu-item__title'>{intl.formatMessage(messages.donate_crypto)}</span>
|
||||
</NavLink>}
|
||||
<NavLink className='sidebar-menu-item' to='/lists' onClick={this.handleClose}>
|
||||
{features.lists && <NavLink className='sidebar-menu-item' to='/lists' onClick={this.handleClose}>
|
||||
<Icon id='list' />
|
||||
<span className='sidebar-menu-item__title'>{intl.formatMessage(messages.lists)}</span>
|
||||
</NavLink>
|
||||
<NavLink className='sidebar-menu-item' to='/bookmarks' onClick={this.handleClose}>
|
||||
</NavLink>}
|
||||
{features.bookmarks && <NavLink className='sidebar-menu-item' to='/bookmarks' onClick={this.handleClose}>
|
||||
<Icon id='bookmark' />
|
||||
<span className='sidebar-menu-item__title'>{intl.formatMessage(messages.bookmarks)}</span>
|
||||
</NavLink>
|
||||
</NavLink>}
|
||||
</div>
|
||||
|
||||
<div className='sidebar-menu__section'>
|
||||
|
|
|
@ -290,7 +290,7 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||
}
|
||||
|
||||
_makeMenu = (publicStatus) => {
|
||||
const { status, intl, withDismiss, withGroupAdmin, me, isStaff, isAdmin } = this.props;
|
||||
const { status, intl, withDismiss, withGroupAdmin, me, features, isStaff, isAdmin } = this.props;
|
||||
const mutingConversation = status.get('muted');
|
||||
const ownAccount = status.getIn(['account', 'id']) === me;
|
||||
|
||||
|
@ -303,7 +303,9 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||
// menu.push({ text: intl.formatMessage(messages.embed), action: this.handleEmbed });
|
||||
}
|
||||
|
||||
menu.push({ text: intl.formatMessage(status.get('bookmarked') ? messages.unbookmark : messages.bookmark), action: this.handleBookmarkClick });
|
||||
if (features.bookmarks) {
|
||||
menu.push({ text: intl.formatMessage(status.get('bookmarked') ? messages.unbookmark : messages.bookmark), action: this.handleBookmarkClick });
|
||||
}
|
||||
|
||||
if (!me) {
|
||||
return menu;
|
||||
|
|
|
@ -189,16 +189,21 @@ class Header extends ImmutablePureComponent {
|
|||
menu.push({ text: intl.formatMessage(messages.showReblogs, { name: account.get('username') }), action: this.props.onReblogToggle });
|
||||
}
|
||||
|
||||
if (account.getIn(['relationship', 'subscribing'])) {
|
||||
menu.push({ text: intl.formatMessage(messages.unsubscribe, { name: account.get('username') }), action: this.props.onSubscriptionToggle });
|
||||
} else {
|
||||
menu.push({ text: intl.formatMessage(messages.subscribe, { name: account.get('username') }), action: this.props.onSubscriptionToggle });
|
||||
if (features.accountSubscriptions) {
|
||||
if (account.getIn(['relationship', 'subscribing'])) {
|
||||
menu.push({ text: intl.formatMessage(messages.unsubscribe, { name: account.get('username') }), action: this.props.onSubscriptionToggle });
|
||||
} else {
|
||||
menu.push({ text: intl.formatMessage(messages.subscribe, { name: account.get('username') }), action: this.props.onSubscriptionToggle });
|
||||
}
|
||||
}
|
||||
|
||||
if (features.lists) {
|
||||
menu.push({ text: intl.formatMessage(messages.add_or_remove_from_list), action: this.props.onAddToList });
|
||||
}
|
||||
|
||||
menu.push({ text: intl.formatMessage(messages.add_or_remove_from_list), action: this.props.onAddToList });
|
||||
// menu.push({ text: intl.formatMessage(account.getIn(['relationship', 'endorsed']) ? messages.unendorse : messages.endorse), action: this.props.onEndorseToggle });
|
||||
menu.push(null);
|
||||
} else if (features.unrestrictedLists) {
|
||||
} else if (features.lists && features.unrestrictedLists) {
|
||||
menu.push({ text: intl.formatMessage(messages.add_or_remove_from_list), action: this.props.onAddToList });
|
||||
}
|
||||
|
||||
|
|
|
@ -315,7 +315,9 @@ class ActionBar extends React.PureComponent {
|
|||
// menu.push({ text: intl.formatMessage(messages.embed), action: this.handleEmbed });
|
||||
}
|
||||
|
||||
menu.push({ text: intl.formatMessage(status.get('bookmarked') ? messages.unbookmark : messages.bookmark), action: this.handleBookmarkClick });
|
||||
if (features.bookmarks) {
|
||||
menu.push({ text: intl.formatMessage(status.get('bookmarked') ? messages.unbookmark : messages.bookmark), action: this.handleBookmarkClick });
|
||||
}
|
||||
|
||||
menu.push(null);
|
||||
|
||||
|
|
|
@ -62,15 +62,19 @@ class FeaturesPanel extends React.PureComponent {
|
|||
{intl.formatMessage(messages.follow_requests)}
|
||||
</NavLink>}
|
||||
|
||||
<NavLink className='promo-panel-item' to='/bookmarks'>
|
||||
<Icon id='bookmark' className='promo-panel-item__icon' fixedWidth />
|
||||
{intl.formatMessage(messages.bookmarks)}
|
||||
</NavLink>
|
||||
{features.bookmarks && (
|
||||
<NavLink className='promo-panel-item' to='/bookmarks'>
|
||||
<Icon id='bookmark' className='promo-panel-item__icon' fixedWidth />
|
||||
{intl.formatMessage(messages.bookmarks)}
|
||||
</NavLink>
|
||||
)}
|
||||
|
||||
<NavLink className='promo-panel-item' to='/lists'>
|
||||
<Icon id='list' className='promo-panel-item__icon' fixedWidth />
|
||||
{intl.formatMessage(messages.lists)}
|
||||
</NavLink>
|
||||
{features.lists && (
|
||||
<NavLink className='promo-panel-item' to='/lists'>
|
||||
<Icon id='list' className='promo-panel-item__icon' fixedWidth />
|
||||
{intl.formatMessage(messages.lists)}
|
||||
</NavLink>
|
||||
)}
|
||||
|
||||
{features.securityAPI ? (
|
||||
<NavLink className='promo-panel-item' to='/auth/edit'>
|
||||
|
|
Ładowanie…
Reference in New Issue