Add elements count to antennas page
This commit is contained in:
parent
f99dde6df1
commit
d23ecd1dff
3 changed files with 30 additions and 4 deletions
|
@ -5,10 +5,11 @@ import { NavLink } from 'react-router-dom';
|
|||
|
||||
import { Icon } from 'mastodon/components/icon';
|
||||
|
||||
const ColumnLink = ({ icon, text, to, href, method, badge, transparent, ...other }) => {
|
||||
const ColumnLink = ({ icon, text, to, href, method, badge, transparent, children, ...other }) => {
|
||||
const className = classNames('column-link', { 'column-link--transparent': transparent });
|
||||
const badgeElement = typeof badge !== 'undefined' ? <span className='column-link__badge'>{badge}</span> : null;
|
||||
const iconElement = typeof icon === 'string' ? <Icon id={icon} fixedWidth className='column-link__icon' /> : icon;
|
||||
const childElement = typeof children !== 'undefined' ? <p>{children}</p> : null;
|
||||
|
||||
if (href) {
|
||||
return (
|
||||
|
@ -24,6 +25,7 @@ const ColumnLink = ({ icon, text, to, href, method, badge, transparent, ...other
|
|||
{iconElement}
|
||||
<span>{text}</span>
|
||||
{badgeElement}
|
||||
{childElement}
|
||||
</NavLink>
|
||||
);
|
||||
}
|
||||
|
@ -37,6 +39,7 @@ ColumnLink.propTypes = {
|
|||
method: PropTypes.string,
|
||||
badge: PropTypes.node,
|
||||
transparent: PropTypes.bool,
|
||||
children: PropTypes.any,
|
||||
};
|
||||
|
||||
export default ColumnLink;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue