0
0
Fork 0

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:
Eugen Rochko 2018-01-21 13:20:20 +01:00 committed by GitHub
parent 1287de1b83
commit 31d1485887
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 5 deletions

View file

@ -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;