Skip to content

Hardcoded Navigation and Routing Improvements #433

@codeCraft-Ritik

Description

@codeCraft-Ritik

Summary :

The Header.js component uses hardcoded navigation links and the Main.js container uses an older version of react-router-dom (Switch). Modernizing the routing and making the header data-driven would improve maintainability.

File Path : components/header/Header.js and containers/Main.js

Code Improvement :

// Suggested change in Header.js to use a configuration file
import { greeting } from "../../portfolio.js"; // Assume data is centralized

// Instead of hardcoded <li> tags, map through a config
{navigation_links.map((link) => (
  <li key={link.id}>
    <NavLink to={link.to} activeStyle={{ fontWeight: "bold" }}>
      {link.name}
    </NavLink>
  </li>
))}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions