feat: add cloud services dropdown menu in header

- Replaced individual cloud service pages with CallToAction components for Compute, Storage and GPU
- Added dropdown menu in header to consolidate cloud service navigation options
- Removed redundant page components (Compute.tsx, Storage.tsx, Gpu.tsx) that shared identical layouts
- Updated route components to use new CallToAction components
- Added ChevronDownIcon to visually indicate dropdown functionality
This commit is contained in:
2025-10-24 15:50:12 +02:00
parent 11689fdd37
commit 752668b38d
9 changed files with 197 additions and 99 deletions

View File

@@ -1,4 +1,6 @@
import { Link } from 'react-router-dom'
import { Dropdown } from './ui/Dropdown'
import { ChevronDownIcon } from '@heroicons/react/20/solid'
import { Container } from './Container'
import { Button } from './Button'
import pmyceliumLogo from '../images/logos/pmyceliumlogo.png'
@@ -13,12 +15,20 @@ export function Header() {
<img src={pmyceliumLogo} alt="Mycelium" className="h-8 w-auto" />
</Link>
<div className="hidden lg:flex lg:gap-10">
<Link
to="/cloud"
className="text-base/7 tracking-tight text-gray-700 hover:text-cyan-500 transition-colors"
>
Cloud
</Link>
<Dropdown
buttonContent={
<>
Cloud
<ChevronDownIcon className="h-5 w-5" aria-hidden="true" />
</>
}
items={[
{ name: 'Cloud', href: '/cloud' },
{ name: 'Compute', href: '/compute' },
{ name: 'Storage', href: '/storage' },
{ name: 'GPU', href: '/gpu' },
]}
/>
<Link
to="/network"
className="text-base/7 tracking-tight text-gray-700 hover:text-cyan-500 transition-colors"

View File

@@ -0,0 +1,55 @@
import { Menu, Transition } from '@headlessui/react'
import { Fragment } from 'react'
import { Link } from 'react-router-dom'
interface DropdownItem {
name: string
href: string
}
interface DropdownProps {
buttonContent: React.ReactNode
items: DropdownItem[]
}
export function Dropdown({ buttonContent, items }: DropdownProps) {
return (
<Menu as="div" className="relative inline-block text-left">
<div>
<Menu.Button className="inline-flex w-full justify-center items-center gap-x-1.5 rounded-md bg-white text-base/7 tracking-tight text-gray-700 hover:text-cyan-500 transition-colors">
{buttonContent}
</Menu.Button>
</div>
<Transition
as={Fragment}
enter="transition ease-out duration-100"
enterFrom="transform opacity-0 scale-95"
enterTo="transform opacity-100 scale-100"
leave="transition ease-in duration-75"
leaveFrom="transform opacity-100 scale-100"
leaveTo="transform opacity-0 scale-95"
>
<Menu.Items className="absolute right-0 z-10 mt-2 w-56 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none">
<div className="py-1">
{items.map((item) => (
<Menu.Item key={item.href}>
{({ active }) => (
<Link
to={item.href}
className={`
${active ? 'bg-gray-100 text-gray-900' : 'text-gray-700'}
'block px-4 py-2 text-sm'
`}
>
{item.name}
</Link>
)}
</Menu.Item>
))}
</div>
</Menu.Items>
</Transition>
</Menu>
)
}