Repository: covid19india/covid19india-react
File: src/components/navbar.js (JavaScript)

Code before:
          animationDelay: "0.5s",
          height: view === "Clusters" ? "2.5rem" : "",
          transition: "all 0.3s ease-in-out"
        }}
      >
        <img
          className="fadeInUp"
          src="/icon.png"
          style={{
            animationDelay: "0.0s",
            width: view === "Clusters" ? "1.5rem" : "",
            height: view === "Clusters" ? "1.5rem" : "",
            transition: "all 0.3s ease-in-out"
          }}
        />

        <div className="navbar-left">
          <Link
            to="/"
            onClick={() => {
              setView("Home");
            }}
          >
            <span
              className={`fadeInUp ${props.location.pathname === "/" ? "focused" : ""}`}
              style={{ animationDelay: "0.2s" }}
            >
              Home
            </span>
          </Link>

          {/* <Link to="/updates" onClick={()=>{
            setView('Updates');
          }}>
            <span className={`fadeInUp ${view==='Updates' ? 'focused' : ''}`} style={{animationDelay: '0.2s'}}>Updates</span>
          </Link>*/}

          <Link
            to="/clusters"
            onClick={() => {
              setView("Clusters");
            }}
          >
            <span
              className={`fadeInUp ${props.location.pathname === "/clusters" ? "focused" : ""}`}
              style={{ animationDelay: "0.3s" }}
            >
              Clusters
            </span>
          </Link>


Review comment (suggestion):
This can be made into a method. It will cutdown the verbosity.

```
const navProps = (path, animationDelay) =>  ({
   className: `fadeInUp ${props.location.pathname === path ? "focussed": ""}`,
   state={{ animationDelay: `${animationDelay}s`}}
})
```
```
<span {...navProps('/', 0.2)} />
  Home
</span>
```

Code after:
    }
  });

  if (window.location.pathname !== "/summary") {
    return (
      <div
        className="Navbar"
        style={{
          animationDelay: "0.5s",
          height: view === "Clusters" ? "2.5rem" : "",
          transition: "all 0.3s ease-in-out"
        }}
      >
        <img
          className="fadeInUp"
          src="/icon.png"
          style={{
            animationDelay: "0.0s",
            width: view === "Clusters" ? "1.5rem" : "",
            height: view === "Clusters" ? "1.5rem" : "",
            transition: "all 0.3s ease-in-out"
          }}
        />

        <div className="navbar-left">
          <Link
            to="/"
            onClick={() => {
              setView("Home");
            }}
          >
            <span {...navLinkProps('/', 0.2)}>
              Home
            </span>
          </Link>

          {/* <Link to="/updates" onClick={()=>{
            setView('Updates');
          }}>
            <span className={`fadeInUp ${view==='Updates' ? 'focused' : ''}`} style={{animationDelay: '0.2s'}}>Updates</span>
          </Link>*/}

          <Link
            to="/clusters"
            onClick={() => {
              setView("Clusters");
            }}
          >
            <span {...navLinkProps('/clusters', 0.3)}>
              Clusters
            </span>