From 1da4e22c9145a5d402c8ca5daed5fe46ec612c97 Mon Sep 17 00:00:00 2001 From: Subham Sangwan Date: Fri, 21 Nov 2025 23:02:50 +0530 Subject: [PATCH] feat: add new Discover page with navigation and routing --- src/AppContent.jsx | 2 + src/components/Navbar.jsx | 5 +- src/pages/Discover.jsx | 142 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 src/pages/Discover.jsx diff --git a/src/AppContent.jsx b/src/AppContent.jsx index b5fbc83..e5bd68c 100644 --- a/src/AppContent.jsx +++ b/src/AppContent.jsx @@ -21,6 +21,7 @@ import ScrollToTop from "./components/ScrollToTop.jsx"; import Members from "./pages/Members.jsx"; import MemberProfile from "./pages/MemberProfile.jsx"; import SettingsMenu from "./components/SettingsMenu.jsx"; +import Discover from "./pages/Discover.jsx"; import { Ion } from "cesium"; import useSettings from "./hooks/UseSettings.jsx"; @@ -45,6 +46,7 @@ const AppContent = () => { } /> } /> } /> + } /> } /> } /> } /> diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx index 3b6c547..b774d07 100644 --- a/src/components/Navbar.jsx +++ b/src/components/Navbar.jsx @@ -64,6 +64,7 @@ const Navbar = () => {
  • Home
  • Newsletter
  • Events
  • +
  • Discover
  • Projects
  • setMenuOpen(false)}> @@ -71,13 +72,13 @@ const Navbar = () => {
  • -
  • +
  • Nebula
  • - +
  • Astronomy News
  • Track
  • diff --git a/src/pages/Discover.jsx b/src/pages/Discover.jsx new file mode 100644 index 0000000..b45c983 --- /dev/null +++ b/src/pages/Discover.jsx @@ -0,0 +1,142 @@ +import { useState } from "react"; +import { motion } from "framer-motion"; + +const Discover = () => { + const [activeTab, setActiveTab] = useState("all"); + + // Dummy Data + const images = [ + { id: 1, src: "https://images.unsplash.com/photo-1451187580459-43490279c0fa?q=80&w=2072&auto=format&fit=crop", title: "Starry Night", category: "images" }, + { id: 2, src: "https://images.unsplash.com/photo-1446776811953-b23d57bd21aa?q=80&w=2072&auto=format&fit=crop", title: "Nebula", category: "images" }, + { id: 3, src: "https://images.unsplash.com/photo-1462331940025-496dfbfc7564?q=80&w=2022&auto=format&fit=crop", title: "Galaxy", category: "images" }, + { id: 4, src: "https://images.unsplash.com/photo-1532968961962-8a0cb3a2d4f5?q=80&w=2071&auto=format&fit=crop", title: "Astronaut", category: "images" }, + ]; + + const videos = [ + { id: 1, src: "https://www.youtube.com/embed/libKVRa01L8", title: "Space Exploration", category: "videos" }, + { id: 2, src: "https://www.youtube.com/embed/uD4izuDMUQA", title: "Mars Mission", category: "videos" }, + ]; + + const events = [ + { id: 1, date: "2023-10-15", title: "Stargazing Night", description: "A wonderful night under the stars.", category: "events" }, + { id: 2, date: "2023-11-20", title: "Rocket Workshop", description: "Learning how to build rockets.", category: "events" }, + ]; + + const recordings = [ + { id: 1, title: "Intro to Astrophysics", duration: "45 min", category: "recordings" }, + { id: 2, title: "Black Holes Explained", duration: "60 min", category: "recordings" }, + ]; + + const allContent = [...images, ...videos, ...events, ...recordings]; + + const filteredContent = activeTab === "all" ? allContent : allContent.filter(item => item.category === activeTab); + + return ( +
    + +

    + Discover SAST +

    +

    + Explore our gallery of images, videos, past events, and session recordings. +

    +
    + + {/* Tabs */} +
    + {["all", "images", "videos", "events", "recordings"].map((tab) => ( + + ))} +
    + + {/* Content Grid */} +
    + {filteredContent.map((item) => ( + + {/* Images */} + {item.category === "images" && ( +
    + {item.title} +
    +

    {item.title}

    +
    +
    + )} + + {/* Videos */} + {item.category === "videos" && ( +
    + +
    +

    {item.title}

    +
    +
    + )} + + {/* Events */} + {item.category === "events" && ( +
    +
    +
    {item.date}
    +

    {item.title}

    +

    {item.description}

    +
    + +
    + )} + + {/* Recordings */} + {item.category === "recordings" && ( +
    +
    + + + +
    +
    +

    {item.title}

    +

    {item.duration}

    +
    +
    + )} +
    + ))} +
    +
    + ); +}; + +export default Discover;