Darep/Beatstream

View on GitHub
app/assets/javascripts/components/sidebar.js.jsx

Summary

Maintainability
A
0 mins
Test Coverage
/** @jsx React.DOM */

var App = window.App || {};

App.Sidebar = React.createClass({
  render: function() {
    var count = this.props.count;
    count = typeof count !== 'undefined' ? this.formattedCount(count) : '-';

    return (
      <div id="sidebar">
        <div id="sidebar-wrap">
          <ul className="common">
            <li className="all-music act">
              <a href="#">All music <span className="count">{count}</span></a>
            </li>
          </ul>
          <p className="none">
            Playlists haven't been implemented yet! Stay tuned.
          </p>
        </div>
      </div>
    );
  },

  formattedCount: function (count) {
    return commify( parseInt(count, 10) );
  }
});