From 4efd6592149d519b6521892080792bbbb1f055b1 Mon Sep 17 00:00:00 2001 From: Inferno-SS5 Date: Thu, 19 Jun 2025 12:22:06 +0530 Subject: [PATCH] Redesigned navbar dropdown with improved styling and structure --- package.json | 7 +++--- src/theme/NavbarItem/DropdownNavbarItem.js | 29 ++++++++++++++++++---- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 123a0412c..0b314f4fc 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "ajv-keywords": "^3.5.2", "clsx": "^2.0.0", "lint": "^0.8.19", + "lucide-react": "^0.517.0", "prism-react-renderer": "^2.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -52,20 +53,20 @@ "devDependencies": { "@docusaurus/plugin-client-redirects": "^3.2.1", "@tailwindcss/typography": "^0.5.0", - "autoprefixer": "^10.4.0", + "autoprefixer": "^10.4.21", "docusaurus": "^1.14.7", "docusaurus-tailwindcss-loader": "file:plugins/docusaurus-tailwindcss-loader", "eslint": "^7.32.0", "eslint-plugin-react": "^7.23.2", "husky": "^6.0.0", "lint-staged": "^11.1.2", - "postcss": "^8.4.4", + "postcss": "^8.5.6", "postcss-import": "^14.0.2", "postcss-preset-env": "^7.4.1", "prettier": "^2.5.1", "prettier-plugin-tailwindcss": "^0.1.4", "rimraf": "^6.0.1", - "tailwindcss": "^3.0.1" + "tailwindcss": "^3.4.17" }, "engines": { "node": ">=18.0" diff --git a/src/theme/NavbarItem/DropdownNavbarItem.js b/src/theme/NavbarItem/DropdownNavbarItem.js index b79d93149..6e37e76ca 100644 --- a/src/theme/NavbarItem/DropdownNavbarItem.js +++ b/src/theme/NavbarItem/DropdownNavbarItem.js @@ -1,13 +1,32 @@ import React from "react"; -import {useLocation} from "@docusaurus/router"; +import { useLocation } from "@docusaurus/router"; import DropdownNavbarItem from "@theme-original/NavbarItem/DropdownNavbarItem"; export default function DropdownNavbarItemWrapper(props) { - const {search, hash} = useLocation(); + const { search, hash } = useLocation(); + + // Update the first item's link dynamically props.items[0].to = `/server/installation/${search}${hash}`; + return ( - <> - - +
+ +
+ {props.items.map((item, idx) => ( + + {item.label} + + ))} +
+
); }