import React, { Component } from 'react';
import Cookies from 'universal-cookie';
import { Link } from 'react-router-dom';
import Section from 'shared/components/section/section';
import styles from './dashboard.css';

class Dashboard extends Component {
  state = {
    mentor: null
  }

  componentWillMount() {
    const cookies = new Cookies();
    this.setState({ mentor: cookies.get('mentor') });
  }

  renderLinks = () => {
    const { mentor } = this.state;
    return mentor === 'true'
      ? (
        <div>
          <h1 className={styles.link}>
            <Link to="/mentor/requests">View Requests</Link>
          </h1>
          <h1 className={styles.link}>
            <Link to="/squads/new-squad">Create a Squad</Link>
          </h1>
          <h1 className={styles.link}>
            <Link to="/squads">View Squads</Link>
          </h1>
          <h1 className={styles.link}>
            <Link to="/mentors">View Mentors</Link>
          </h1>
        </div>
      ) : (
        <div>
          <h1 className={styles.link}>
            <Link to="/mentor-request">Request Help</Link>
          </h1>
          <h1 className={styles.link}>
            <Link to="/squads">Join a Squad</Link>
          </h1>
          <h1 className={styles.link}>
            <Link to="/mentors">View Mentors</Link>
          </h1>
        </div>
      );
  }
  render() {
    return (
      <Section title="What would you like to do?" theme="white">
        {this.renderLinks()}
      </Section>
    );
  }
}

export default Dashboard;

@@ -556,124 +556,8 @@
 k%7D%3E%0A
-            %3CLink to=%22/mentor/requests%22%3EView Requests%3C/Link%3E%0A          %3C/h1%3E%0A          %3Ch1 className=%7Bstyles.link%7D%3E%0A
     
@@ -607,32 +607,32 @@
  a Squad%3C/Link%3E%0A
+
           %3C/h1%3E%0A
@@ -740,115 +740,8 @@
 h1%3E%0A
-          %3Ch1 className=%7Bstyles.link%7D%3E%0A            %3CLink to=%22/mentors%22%3EView Mentors%3C/Link%3E%0A          %3C/h1%3E%0A
     
@@ -922,32 +922,32 @@
 =%7Bstyles.link%7D%3E%0A
+
             %3CLin
@@ -1001,115 +1001,8 @@
 h1%3E%0A
-          %3Ch1 className=%7Bstyles.link%7D%3E%0A            %3CLink to=%22/mentors%22%3EView Mentors%3C/Link%3E%0A          %3C/h1%3E%0A
     

remove mentors/requests link from dashboard page as well