mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 11:36:17 +00:00
Update proxmox-dashboard.tsx
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import type React from "react"
|
|
||||||
|
|
||||||
import { useState, useEffect, useMemo, useCallback } from "react"
|
import { useState, useEffect, useMemo, useCallback } from "react"
|
||||||
import { Badge } from "./ui/badge"
|
import { Badge } from "./ui/badge"
|
||||||
import { Button } from "./ui/button"
|
import { Button } from "./ui/button"
|
||||||
@@ -135,11 +133,11 @@ export function ProxmoxDashboard() {
|
|||||||
const handleScroll = () => {
|
const handleScroll = () => {
|
||||||
const currentScrollY = window.scrollY
|
const currentScrollY = window.scrollY
|
||||||
|
|
||||||
// Only hide navigation if scrolled down more than 100px
|
if (currentScrollY < 50) {
|
||||||
if (currentScrollY < 100) {
|
// Show navigation when near top
|
||||||
setShowNavigation(true)
|
setShowNavigation(true)
|
||||||
} else if (currentScrollY > lastScrollY) {
|
} else if (currentScrollY > lastScrollY && currentScrollY > 100) {
|
||||||
// Scrolling down - hide navigation
|
// Scrolling down - hide navigation (only after 100px)
|
||||||
setShowNavigation(false)
|
setShowNavigation(false)
|
||||||
} else if (currentScrollY < lastScrollY) {
|
} else if (currentScrollY < lastScrollY) {
|
||||||
// Scrolling up - show navigation
|
// Scrolling up - show navigation
|
||||||
@@ -319,12 +317,16 @@ export function ProxmoxDashboard() {
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className={`sticky top-[var(--header-height)] z-40 bg-background transition-transform duration-300 ${
|
className={`sticky bg-background border-b border-border transition-transform duration-300 ease-in-out ${
|
||||||
showNavigation ? "translate-y-0" : "-translate-y-full"
|
showNavigation ? "translate-y-0" : "-translate-y-[calc(100%+1px)]"
|
||||||
}`}
|
}`}
|
||||||
style={{ "--header-height": "88px" } as React.CSSProperties}
|
style={{
|
||||||
|
top: "0",
|
||||||
|
zIndex: 40,
|
||||||
|
marginTop: "0",
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div className="container mx-auto px-4 md:px-6 pt-4 md:pt-6">
|
<div className="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-4">
|
||||||
<Tabs value={activeTab} onValueChange={setActiveTab} className="space-y-0">
|
<Tabs value={activeTab} onValueChange={setActiveTab} className="space-y-0">
|
||||||
<TabsList className="hidden md:grid w-full grid-cols-6 bg-card border border-border">
|
<TabsList className="hidden md:grid w-full grid-cols-6 bg-card border border-border">
|
||||||
<TabsTrigger
|
<TabsTrigger
|
||||||
|
|||||||
Reference in New Issue
Block a user