diff --git a/src/pages/dashboard/dashboard.css b/src/pages/dashboard/dashboard.css index 652f13dc..dfb576d6 100644 --- a/src/pages/dashboard/dashboard.css +++ b/src/pages/dashboard/dashboard.css @@ -6,8 +6,10 @@ position:relative; } -/* Dashboard Menu Button - Mobile Only */ -.dashboard-menu-btn { + + +/* Dashboard Menu Button - Mobile Only */ + /* .dashboard-menu-btn { display: none; position: fixed; top: 70px; @@ -24,19 +26,26 @@ font-weight: bold; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); transition: all 0.3s ease; -} +} */ + -.dashboard-menu-btn:hover { +/* .dashboard-menu-btn:hover { background: var(--ifm-color-primary-dark); transform: scale(1.05); } -.dashboard-menu-btn.open { + + + + .dashboard-menu-btn.open { background: #dc3545; -} +} */ -/* Mobile Menu */ -.dashboard-mobile-menu { + + + +/* Mobile Menu */ + .dashboard-mobile-menu { display: none; position: fixed; top: 0; @@ -47,21 +56,34 @@ pointer-events: none; } + + .dashboard-mobile-menu.show { display: block; pointer-events: all; } + + + + +/* Overlay */ .dashboard-menu-overlay { - position: absolute; + position: fixed; top: 0; left: 0; - right: 0; - bottom: 0; - background: rgba(0, 0, 0, 0.5); - z-index: 1051; + width: 100vw; + height: 100vh; + background: rgba(0,0,0,0.5); + z-index: 1050; } + + + + + + .dashboard-mobile-menu > div:last-child { position: absolute; top: 0; @@ -103,7 +125,7 @@ padding: 0; width: 30px; height: 30px; - display: flex; + display: flex ; align-items: center; justify-content: center; } diff --git a/src/pages/dashboard/giveaway/index.tsx b/src/pages/dashboard/giveaway/index.tsx index 80f9307b..e184a623 100644 --- a/src/pages/dashboard/giveaway/index.tsx +++ b/src/pages/dashboard/giveaway/index.tsx @@ -7,6 +7,7 @@ import NavbarIcon from "../../../components/navbar/NavbarIcon"; import { useHistory } from "@docusaurus/router"; import { Home, MessageCircle, Gift, Trophy, Crown, Star, Award, Clock, Users, TrendingUp, Medal, ArrowLeft } from "lucide-react"; import "../dashboard.css"; +import { add } from "date-fns"; // Giveaway-specific styles const giveawayStyles = ` @@ -421,7 +422,8 @@ const giveawayStyles = ` } `; -// Inject styles + + if (typeof document !== 'undefined') { const existingStyle = document.getElementById('giveaway-styles'); if (!existingStyle) { @@ -449,7 +451,7 @@ const GiveawayPage: React.FC = () => { const [loading, setLoading] = useState(true); const [activeTab, setActiveTab] = useState<"home" | "discuss" | "contributors" | "giveaway">("giveaway"); - // Close dashboard menu when clicking outside + useEffect(() => { const handleClickOutside = (event: MouseEvent) => { const target = event.target as Element; @@ -466,18 +468,25 @@ const GiveawayPage: React.FC = () => { document.addEventListener('mousedown', handleClickOutside); } + return () => { + + + + + document.removeEventListener('mousedown', handleClickOutside); }; }, [showDashboardMenu]); - // Ensure active tab is set correctly when page loads useEffect(() => { - // We're on the giveaway page, so the active tab should be "giveaway" setActiveTab("giveaway"); }, []); useEffect(() => { + + + // Simulate fetching leaderboard data const fetchLeaderboard = async () => { setLoading(true); @@ -578,36 +587,37 @@ const GiveawayPage: React.FC = () => {