Display number of follow requests in getting started menu, and (#6313)
if notifications column is not mounted, also display number of unread notifications there.
This commit is contained in:
@ -2,12 +2,15 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
const ColumnLink = ({ icon, text, to, href, method }) => {
|
||||
const ColumnLink = ({ icon, text, to, href, method, badge }) => {
|
||||
const badgeElement = typeof badge !== 'undefined' ? <span className='column-link__badge'>{badge}</span> : null;
|
||||
|
||||
if (href) {
|
||||
return (
|
||||
<a href={href} className='column-link' data-method={method}>
|
||||
<i className={`fa fa-fw fa-${icon} column-link__icon`} />
|
||||
{text}
|
||||
{badgeElement}
|
||||
</a>
|
||||
);
|
||||
} else {
|
||||
@ -15,6 +18,7 @@ const ColumnLink = ({ icon, text, to, href, method }) => {
|
||||
<Link to={to} className='column-link'>
|
||||
<i className={`fa fa-fw fa-${icon} column-link__icon`} />
|
||||
{text}
|
||||
{badgeElement}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
@ -26,6 +30,7 @@ ColumnLink.propTypes = {
|
||||
to: PropTypes.string,
|
||||
href: PropTypes.string,
|
||||
method: PropTypes.string,
|
||||
badge: PropTypes.node,
|
||||
};
|
||||
|
||||
export default ColumnLink;
|
||||
|
Reference in New Issue
Block a user