Merge branch 'Hide_Donate' into 'master'

Hide Donate button in mobile sidebar when Patron disabled. Fixes #71

Closes #71

See merge request soapbox-pub/soapbox-fe!8
merge-requests/9/merge
Alex Gleason 2020-05-17 01:49:53 +00:00
commit 244051277f
1 zmienionych plików z 8 dodań i 5 usunięć

Wyświetl plik

@ -40,6 +40,7 @@ const mapStateToProps = state => {
return {
account: getAccount(state, me),
sidebarOpen: state.get('sidebar').sidebarOpen,
hasPatron: state.getIn(['soapbox', 'extensions', 'patron']),
};
};
@ -65,7 +66,7 @@ class SidebarMenu extends ImmutablePureComponent {
};
render() {
const { sidebarOpen, onClose, intl, account, onClickLogOut } = this.props;
const { sidebarOpen, onClose, intl, account, onClickLogOut, hasPatron } = this.props;
if (!account) return null;
const acct = account.get('acct');
@ -117,10 +118,12 @@ class SidebarMenu extends ImmutablePureComponent {
<Icon id='envelope' />
<span className='sidebar-menu-item__title'>{intl.formatMessage(messages.messages)}</span>
</NavLink>
{hasPatron ?
<NavLink className='sidebar-menu-item' to='/donate' onClick={onClose}>
<Icon id='dollar' />
<span className='sidebar-menu-item__title'>{intl.formatMessage(messages.donate)}</span>
</NavLink>
: ''}
<NavLink className='sidebar-menu-item' to='/lists' onClick={onClose}>
<Icon id='list' />
<span className='sidebar-menu-item__title'>{intl.formatMessage(messages.lists)}</span>