{"size": 1065, "ext": "js", "max_stars_repo_path": "client/src/components/Navbar.js", "max_stars_repo_name": "Yosefc/NHL-Subscription", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "client/src/components/Navbar.js", "max_issues_repo_name": "Yosefc/NHL-Subscription", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "client/src/components/Navbar.js", "max_forks_repo_name": "Yosefc/NHL-Subscription", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.3571428571, "max_line_length": 95, "alphanum_fraction": 0.4732394366}
import React, { useState } from "react";
import { Link } from "react-router-dom";

const Navbar = () => {
  const [currentURLNavItem, setURLNavItem] = useState(window.location.pathname);
  return (
    <header className="App-header">
      <nav className="nav-bar">
        <Link
          to="/"
          className={`nav-item ${currentURLNavItem === "/" ? "selected-link" : ""}`}
          onClick={_ => {
            setURLNavItem("/");
          }}
        >
          Home
        </Link>
        <Link
          to="/unsubscribe"
          className={`nav-item ${currentURLNavItem === "/unsubscribe" ? "selected-link" : ""}`}
          onClick={_ => {
            setURLNavItem("/unsubscribe");
          }}
        >
          Unsubscribe
        </Link>
        <Link
          to="/stats"
          className={`nav-item ${currentURLNavItem === "/stats" ? "selected-link" : ""}`}
          onClick={_ => {
            setURLNavItem("/stats");
          }}
        >
          Stats
        </Link>
      </nav>
    </header>
  );
};

export default Navbar;
