From a799b648b39ab21c3167df660efd19a22078e256 Mon Sep 17 00:00:00 2001 From: Akriti sharma Date: Sun, 23 Nov 2025 20:29:23 +0100 Subject: [PATCH] done --- src/App.css | 58 ++++++++++++++++-------------------- src/App.jsx | 32 ++++++++++++++++++-- src/components/Navbar.jsx | 6 +++- src/main.jsx | 20 ++++++++----- src/pages/CompanyPage.jsx | 35 ++++++++++++++++++++-- src/pages/HomePage.jsx | 19 ++++++++++-- src/pages/TechnologyPage.jsx | 27 +++++++++++++++-- 7 files changed, 144 insertions(+), 53 deletions(-) diff --git a/src/App.css b/src/App.css index b9d355d..b6b4431 100644 --- a/src/App.css +++ b/src/App.css @@ -1,42 +1,34 @@ -#root { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; -} - -.logo { - height: 6em; - padding: 1.5em; - will-change: filter; - transition: filter 300ms; -} -.logo:hover { - filter: drop-shadow(0 0 2em #646cffaa); -} -.logo.react:hover { - filter: drop-shadow(0 0 2em #61dafbaa); +.navbar { + background: #222; + color: white; + padding: 15px; + font-size: 24px; } -@keyframes logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } +.page { + padding: 20px; } -@media (prefers-reduced-motion: no-preference) { - a:nth-of-type(2) .logo { - animation: logo-spin infinite 20s linear; - } +.company-list, +.tech-list { + list-style: none; + padding: 0; + display: flex; + gap: 20px; + flex-wrap: wrap; } -.card { - padding: 2em; +.company-item, +.tech-item { + border: 1px solid #ccc; + padding: 10px; + width: 150px; + text-align: center; + border-radius: 10px; + transition: 0.3s; } -.read-the-docs { - color: #888; +.company-item:hover, +.tech-item:hover { + background: #f3f3f3; } diff --git a/src/App.jsx b/src/App.jsx index 1b51d87..005bc95 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,9 +1,37 @@ +import { useState } from "react"; import "./App.css"; +import companiesData from "./companies.json"; +import technologiesData from "./technologies.json"; + +import { Routes, Route } from "react-router-dom"; + +import Navbar from "./components/Navbar"; +import HomePage from "./pages/HomePage"; +import CompanyPage from "./pages/CompanyPage"; +import TechnologyPage from "./pages/TechnologyPage"; + function App() { + const [companies] = useState(companiesData); + const [technologies] = useState(technologiesData); + return ( -
-

LAB | React Stack Tracker

+
+ + + + } /> + + } + /> + + } + /> +
); } diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx index 09e2806..554a0fb 100644 --- a/src/components/Navbar.jsx +++ b/src/components/Navbar.jsx @@ -1,5 +1,9 @@ function Navbar() { - return ; + return ( + + ); } export default Navbar; diff --git a/src/main.jsx b/src/main.jsx index 54b39dd..d476e0d 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -1,10 +1,14 @@ -import React from 'react' -import ReactDOM from 'react-dom/client' -import App from './App.jsx' -import './index.css' +import React from "react"; +import ReactDOM from "react-dom/client"; +import "./index.css"; +import App from "./App"; -ReactDOM.createRoot(document.getElementById('root')).render( +import { BrowserRouter as Router } from "react-router-dom"; + +ReactDOM.createRoot(document.getElementById("root")).render( - - , -) + + + + +); diff --git a/src/pages/CompanyPage.jsx b/src/pages/CompanyPage.jsx index cc5903c..efcc811 100644 --- a/src/pages/CompanyPage.jsx +++ b/src/pages/CompanyPage.jsx @@ -1,7 +1,36 @@ -function CompanyPage() { +import { useParams, Link } from "react-router-dom"; + +function CompanyPage({ companies }) { + const { companySlug } = useParams(); + + const company = companies.find((c) => c.slug === companySlug); + + if (!company) return

Company not found

; + return ( -
-

CompanyPage

+
+

Company Profile

+ +

{company.companyName}

+ {company.companyName} +

+ Website:{" "} + + {company.website} + +

+ +

Tech Stack

+
    + {company.techStack.map((tech) => ( +
  • + + {tech.name} +

    {tech.name}

    + +
  • + ))} +
); } diff --git a/src/pages/HomePage.jsx b/src/pages/HomePage.jsx index e97e7de..31985f3 100644 --- a/src/pages/HomePage.jsx +++ b/src/pages/HomePage.jsx @@ -1,7 +1,20 @@ -function HomePage() { +import { Link } from "react-router-dom"; + +function HomePage({ companies }) { return ( -
-

HomePage

+
+

StackTracker: Discover Tech Stacks Used by Top Companies

+ +
    + {companies.map((company) => ( +
  • + + {company.companyName} +

    {company.companyName}

    + +
  • + ))} +
); } diff --git a/src/pages/TechnologyPage.jsx b/src/pages/TechnologyPage.jsx index 30f9414..af4d059 100644 --- a/src/pages/TechnologyPage.jsx +++ b/src/pages/TechnologyPage.jsx @@ -1,7 +1,28 @@ -function TechnologyPage() { +import { useParams, useSearchParams, Link } from "react-router-dom"; + +function TechnologyPage({ technologies }) { + const { slug } = useParams(); + const [searchParams] = useSearchParams(); + + const tech = technologies.find((t) => t.slug === slug); + + const previousCompany = searchParams.get("company"); + + if (!tech) return

Technology not found

; + return ( -
-

TechnologyPage

+
+

Technology Details

+ +

{tech.name}

+ {tech.name} +

{tech.description}

+ + {previousCompany && ( + + + + )}
); }