Newer
Older
pokemon-go-trade / static / html / src / components / menu.js
Simon Lindgren on 12 Feb 2021 595 bytes first commit
import React from 'react';
import style from './menu.css';

class Menu extends React.Component {
  constructor(props) {
    super(props);

    const classNames = ['', ''];
    classNames[props.active] = 'active';

    this.state = {
      active: classNames,
    };
  }

  render() {
    return (
      <div>
        <ul>
          <li>
            <a href="index.html" className={this.state.active[0]}>Have</a>
          </li>
          <li>
            <a href="want.html" className={this.state.active[1]}>Want</a>
          </li>
        </ul>
      </div>
    );
  }
}

export default Menu;