bigbuffet-rw/app/soapbox/features/admin/components/admin_nav.js

46 lines
1.6 KiB
JavaScript
Raw Normal View History

2020-12-29 10:34:23 -08:00
import React from 'react';
import { connect } from 'react-redux';
import ImmutablePropTypes from 'react-immutable-proptypes';
2020-12-29 10:34:23 -08:00
import Icon from 'soapbox/components/icon';
import { NavLink } from 'react-router-dom';
import { FormattedMessage } from 'react-intl';
const mapStateToProps = (state, props) => ({
instance: state.get('instance'),
});
export default @connect(mapStateToProps)
2020-12-29 10:34:23 -08:00
class AdminNav extends React.PureComponent {
static propTypes = {
instance: ImmutablePropTypes.map.isRequired,
};
2020-12-29 10:34:23 -08:00
render() {
const { instance } = this.props;
2020-12-29 10:34:23 -08:00
return (
<div className='wtf-panel promo-panel'>
<div className='promo-panel__container'>
<NavLink className='promo-panel-item' to='/admin'>
<Icon id='tachometer' className='promo-panel-item__icon' fixedWidth />
<FormattedMessage id='admin_nav.dashboard' defaultMessage='Dashboard' />
</NavLink>
{/* TODO: Make this actually useful */}
{instance.get('approval_required') && (
<a className='promo-panel-item' href='/pleroma/admin/#/users/index' target='_blank'>
<Icon id='user' className='promo-panel-item__icon' fixedWidth />
<FormattedMessage id='admin_nav.awaiting_approval' defaultMessage='Awaiting Approval' />
</a>
)}
<a className='promo-panel-item' href='/pleroma/admin/#/reports/index' target='_blank'>
<Icon id='gavel' className='promo-panel-item__icon' fixedWidth />
<FormattedMessage id='admin_nav.reports' defaultMessage='Reports' />
</a>
2020-12-29 10:34:23 -08:00
</div>
</div>
);
}
}