varun1729

Untitled

Apr 27th, 2023
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. import React from "react";
  2. import {
  3. BrowserRouter as Router,
  4. Routes,
  5. NavLink,
  6. Route,
  7. } from "react-router-dom";
  8. import About from "./Aboutus";
  9. import Contact from "./Contactus";
  10. import Portfolio from "./Portfolio";
  11. export default class Indexcomponent extends React.Component {
  12. render() {
  13. return (
  14. <div>
  15. <Router>
  16. <nav
  17. style={{
  18. display: "flex",
  19. justifyContent: "space-between",
  20. alignItems: "center",
  21. backgroundColor: "#333",
  22. padding: "10px",
  23. }}
  24. >
  25. <div style={{ display: "flex", alignItems: "center" }}>
  26. <NavLink
  27. to="/about"
  28. style={{
  29. color: "#fff",
  30. marginRight: "20px",
  31. textDecoration: "none",
  32. }}
  33. >
  34. About
  35. </NavLink>
  36. <NavLink
  37. to="/contact"
  38. style={{
  39. color: "#fff",
  40. marginRight: "20px",
  41. textDecoration: "none",
  42. }}
  43. >
  44. Contact
  45. </NavLink>
  46. <NavLink
  47. to="/portfolio"
  48. style={{
  49. color: "#fff",
  50. marginRight: "20px",
  51. textDecoration: "none",
  52. }}
  53. >
  54. Portfolio
  55. </NavLink>
  56. </div>
  57. </nav>
  58. <Routes>
  59. <Route path="/about" element={<About />}></Route>
  60. <Route path="/contact" element={<Contact />}></Route>
  61. <Route path="/portfolio" element={<Portfolio />}></Route>
  62. </Routes>
  63. </Router>
  64. </div>
  65. );
  66. }
  67. }
  68.  
Add Comment
Please, Sign In to add comment