Files
freeCodeCamp/common/app/components/Nav/Points-Nav-Item.jsx
Berkeley Martinez 3f3aab3ff7 Feature(challenges): add code-uri utils
Fix(nav): points nav item propTypes
2016-08-18 09:44:40 -07:00

41 lines
790 B
JavaScript

import React from 'react';
export default React.createClass({
displayName: 'Points',
propTypes: {
'aria-controls': React.PropTypes.string,
className: React.PropTypes.string,
href: React.PropTypes.string,
onClick: React.PropTypes.func,
points: React.PropTypes.number,
title: React.PropTypes.node
},
render() {
let {
href,
title,
points,
'aria-controls': ariaControls, // eslint-disable-line react/prop-types
className,
onClick
} = this.props;
let linkProps = {
title,
href,
onClick,
className,
ref: 'anchor',
'aria-controls': ariaControls
};
return (
<li role='presentation'>
<a { ...linkProps }>[ { points || 1 } ]</a>
</li>
);
}
});