From d353e948f7ff5cbc4ecd09785b116f992ed8410a Mon Sep 17 00:00:00 2001 From: austinkelsay Date: Tue, 18 Mar 2025 17:45:18 -0500 Subject: [PATCH] Fixes for menus, sizing fixes general css finagling, added cool hamburger buttons --- src/components/banner/HeroBanner.js | 2 +- .../content/carousels/CoursesCarousel.js | 2 +- .../content/carousels/DocumentsCarousel.js | 2 +- .../content/carousels/VideosCarousel.js | 2 +- src/components/navbar/Navbar.js | 50 ++++++++++++++++++- src/components/navbar/user/UserAvatar.js | 18 +------ src/components/search/SearchBar.js | 4 +- src/components/search/searchbar.module.css | 19 ------- src/pages/index.js | 1 - 9 files changed, 54 insertions(+), 46 deletions(-) delete mode 100644 src/components/search/searchbar.module.css diff --git a/src/components/banner/HeroBanner.js b/src/components/banner/HeroBanner.js index ac25a14..28e35e9 100644 --- a/src/components/banner/HeroBanner.js +++ b/src/components/banner/HeroBanner.js @@ -103,7 +103,7 @@ const HeroBanner = () => { }; return ( -
+
Banner { const windowWidth = useWindowWidth(); const navbarHeight = '60px'; const {ndk} = useNDKContext(); + const [isHovered, setIsHovered] = useState(false); + const menu = useRef(null); + + const menuItems = [ + { + label: 'Content', + icon: 'pi pi-play-circle', + command: () => router.push('/content?tag=all') + }, + { + label: 'Feeds', + icon: 'pi pi-comments', + command: () => router.push('/feeds?channel=global') + }, + { + label: 'Subscribe', + icon: 'pi pi-star', + command: () => router.push('/subscribe') + }, + { + label: 'About', + icon: 'pi pi-info-circle', + command: () => router.push('/about') + } + ]; const start = (
@@ -25,8 +51,28 @@ const Navbar = () => { height={50} className="rounded-full mr-2 max-tab:hidden max-mob:hidden" /> -

PlebDevs

+

PlebDevs

+
setIsHovered(true)} + onMouseLeave={() => setIsHovered(false)} + onClick={(e) => menu.current.toggle(e)} + style={{ width: '40px', height: '40px' }} + > +
+ {/* Show hamburger menu on mobile (< 600px) and up/down arrows on larger screens */} + {windowWidth <= 600 ? ( + + ) : ( + <> + + + + )} +
+
+ {ndk && windowWidth > 600 && }
); diff --git a/src/components/navbar/user/UserAvatar.js b/src/components/navbar/user/UserAvatar.js index 4d056f7..5b2522e 100644 --- a/src/components/navbar/user/UserAvatar.js +++ b/src/components/navbar/user/UserAvatar.js @@ -70,7 +70,7 @@ const UserAvatar = () => { // Only show the "Create" option for admin users ...(isAdmin ? [{ label: 'Create', - icon: 'pi pi-book', + icon: 'pi pi-file-edit', command: () => router.push('/create') }] : []), { @@ -84,14 +84,6 @@ const UserAvatar = () => { userAvatar = ( <>
- router.push('/about')} - size={windowWidth < 768 ? 'small' : 'normal'} - />
menu.current.toggle(event)} className={`flex flex-row items-center justify-between cursor-pointer hover:opacity-75`}> logo { } else { userAvatar = (
- router.push('/about')} - size={windowWidth < 768 ? 'small' : 'normal'} - /> { const { searchContent, searchResults: contentResults } = useContentSearch(); @@ -77,7 +76,7 @@ const SearchBar = () => { } return ( -
+
{ className: 'mx-0 px-0 shadow-lg' } }} - className={styles.dropdown} value={selectedSearchOption} onChange={(e) => setSelectedSearchOption(e.value)} options={searchOptions} diff --git a/src/components/search/searchbar.module.css b/src/components/search/searchbar.module.css deleted file mode 100644 index f9dd596..0000000 --- a/src/components/search/searchbar.module.css +++ /dev/null @@ -1,19 +0,0 @@ -/* .dropdown { - border: none !important; - outline: none !important; - box-shadow: none !important; -} - -.dropdown:focus, -.dropdown:active, -.dropdown:hover { - border: none !important; - outline: none !important; - box-shadow: none !important; -} */ - -/* Override any potential global styles */ -/* .dropdown * { - outline: none !important; - box-shadow: none !important; -} */ diff --git a/src/pages/index.js b/src/pages/index.js index 60ca6c7..2621452 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,6 +1,5 @@ import Head from 'next/head'; import React, { useEffect, useState, useMemo } from 'react'; -// import GenericCarousel from '@/components/content/carousels/GenericCarousel'; import CoursesCarousel from '@/components/content/carousels/CoursesCarousel'; import VideosCarousel from '@/components/content/carousels/VideosCarousel'; import DocumentsCarousel from '@/components/content/carousels/DocumentsCarousel';