refactor: consolidate navigation links into reusable NavLinks component with dynamic styling

This commit is contained in:
2025-09-19 14:08:46 +02:00
parent ab14a5a8e5
commit 017fc41d2b
4 changed files with 9 additions and 17 deletions

View File

@@ -107,19 +107,7 @@ export function Header() {
className="absolute inset-x-0 top-0 z-0 origin-top rounded-b-2xl bg-gray-900 px-6 pt-32 pb-6 shadow-2xl shadow-gray-900/20" className="absolute inset-x-0 top-0 z-0 origin-top rounded-b-2xl bg-gray-900 px-6 pt-32 pb-6 shadow-2xl shadow-gray-900/20"
> >
<div className="space-y-4"> <div className="space-y-4">
<MobileNavLink href="/#about"> <NavLinks className="block text-base/7 tracking-tight" />
About
</MobileNavLink>
<MobileNavLink href="/#benefits">
Benefits
</MobileNavLink>
<MobileNavLink href="/#features">
Features
</MobileNavLink>
<MobileNavLink href="/#usecases">
Use Cases
</MobileNavLink>
<MobileNavLink href="/#faqs">FAQs</MobileNavLink>
</div> </div>
<div className="mt-8 flex flex-col gap-4"> <div className="mt-8 flex flex-col gap-4">
<Button href="https://docs.ourworld.tf/mycelium_cloud/docs/" variant="outline" color="white" target="_blank" rel="noopener noreferrer"> <Button href="https://docs.ourworld.tf/mycelium_cloud/docs/" variant="outline" color="white" target="_blank" rel="noopener noreferrer">

View File

@@ -3,8 +3,9 @@
import { useRef, useState } from 'react' import { useRef, useState } from 'react'
import Link from 'next/link' import Link from 'next/link'
import { AnimatePresence, motion } from 'framer-motion' import { AnimatePresence, motion } from 'framer-motion'
import clsx from 'clsx'
export function NavLinks() { export function NavLinks({ className }: { className?: string }) {
let [hoveredIndex, setHoveredIndex] = useState<number | null>(null) let [hoveredIndex, setHoveredIndex] = useState<number | null>(null)
let timeoutRef = useRef<number | null>(null) let timeoutRef = useRef<number | null>(null)
@@ -31,7 +32,10 @@ export function NavLinks() {
<Link <Link
key={label} key={label}
href={href} href={href}
className="relative -mx-3 -my-2 rounded-lg px-3 py-2 text-sm text-white transition-colors delay-150 hover:text-gray-300 hover:delay-0" className={clsx(
'relative -mx-3 -my-2 rounded-lg px-3 py-2 text-sm text-white transition-colors delay-150 hover:text-gray-300 hover:delay-0',
className,
)}
onClick={(e) => handleClick(e, href)} onClick={(e) => handleClick(e, href)}
onMouseEnter={() => { onMouseEnter={() => {
if (timeoutRef.current) { if (timeoutRef.current) {

View File

@@ -11,7 +11,7 @@ export function StackSectionPreview() {
<div className="mx-auto max-w-7xl"> <div className="mx-auto max-w-7xl">
<div className="grid grid-cols-1 lg:grid-cols-3 gap-4 lg:gap-16 items-center lg:items-start"> <div className="grid grid-cols-1 lg:grid-cols-3 gap-4 lg:gap-16 items-center lg:items-start">
{/* Left Column - Text (1/3 width) */} {/* Left Column - Text (1/3 width) */}
<div className="text-left lg:text-left lg:col-span-1 order-1 lg:order-1"> <div className="text-center lg:text-left lg:col-span-1 order-1 lg:order-1">
<FadeIn> <FadeIn>
<H2 className=""> <H2 className="">
The Mycelium Stack The Mycelium Stack

View File

@@ -42,7 +42,7 @@ export function Steps() {
<H2 className="text-3xl font-medium tracking-tight" color="light"> <H2 className="text-3xl font-medium tracking-tight" color="light">
Deploy Scalable LLMs and AI Agents in Seconds Deploy Scalable LLMs and AI Agents in Seconds
</H2> </H2>
<P className="mt-6 text-lg" color="light"> <P className="mt-6" color="light">
Launch and scale intelligence on your own terms. Mycelium Cloud makes it simple to deploy models, integrate knowledge, and run everything on a network you control. Launch and scale intelligence on your own terms. Mycelium Cloud makes it simple to deploy models, integrate knowledge, and run everything on a network you control.
</P> </P>
</motion.div> </motion.div>