import React from 'react';

const Navigation = ({ week, day, triggerNavigation }) => {
  const handleNext = () => {
    triggerNavigation(1);
    return false;
  }

  const handlePrevious = () => {
    triggerNavigation(-1);
    return false;
  }

  return (
    <div>
      {
        !(week === 1 && day === 1)
          && <a href="#" onClick={ handlePrevious }>&lsaquo;&lsaquo; Week { day === 1 ? week - 1 : week }, Day { day === 1 ? 3 : day - 1 }</a>
      }
      ...
      {
        !(week === 9 && day === 3)
          && <a href="#" onClick={ handleNext }>Week { day === 3 ? week + 1 : week }, Day { day === 3 ? 1 : day + 1 } &rsaquo;&rsaquo;</a>
      }
    </div>
  )
}

export default Navigation;
import React from 'react';

const Navigation = ({ week, day, triggerNavigation }) => {
  const handleNext = () => {
    triggerNavigation(1);
    return false;
  }

  const handlePrevious = () => {
    triggerNavigation(-1);
    return false;
  }

  return (
    <div>
      {
        !(week === 1 && day === 1)
          && <button onClick={ handlePrevious }>&lsaquo;&lsaquo; Week { day === 1 ? week - 1 : week }, Day { day === 1 ? 3 : day - 1 }</button>
      }
      ...
      {
        !(week === 9 && day === 3)
          && <button onClick={ handleNext }>Week { day === 3 ? week + 1 : week }, Day { day === 3 ? 1 : day + 1 } &rsaquo;&rsaquo;</button>
      }
    </div>
  )
}

export default Navigation;
Switch to buttons to avoid the hash href.
Switch to buttons to avoid the hash href.
