 Icon = require '../icon'
 
 SectionsExercises = React.createClass
+
+  mixins: [addons.PureRenderMixin]
 
   propTypes:
     exercises:   React.PropTypes.array.isRequired

  getScrollTopOffset: -> if @props.scrollFast then 110 else 150 # no idea why the difference, sorry :(

  render: ->
    chapter_sections = _.keys(@props.exercises.grouped).sort()

    <div className="exercise-cards">
      {for cs in chapter_sections

    scrollFast: React.PropTypes.bool
    onExerciseToggle: React.PropTypes.func.isRequired

  mixins: [ScrollTo, addons.PureRenderMixin]

  componentDidMount:   ->
    @scrollToSelector('.exercise-sections', {immediate: @props.scrollFast})
