From 495cc49c84d0df5c4048b04065317c80ed64de7c Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Thu, 19 Sep 2024 03:35:48 -0400 Subject: [PATCH] show the support section in the dashboard loader after 5 seconds --- src/components/dashboard/loader.tsx | 77 +++++++++++++++++++---------- 1 file changed, 51 insertions(+), 26 deletions(-) diff --git a/src/components/dashboard/loader.tsx b/src/components/dashboard/loader.tsx index 4ac564e..e8d8d97 100644 --- a/src/components/dashboard/loader.tsx +++ b/src/components/dashboard/loader.tsx @@ -1,9 +1,10 @@ -import { ReactElement } from "react"; +import { ReactElement, useEffect, useState } from "react"; import Branding from "@/components/branding"; import { ArrowPathIcon, ChartBarSquareIcon } from "@heroicons/react/24/outline"; import Link from "next/link"; import SimpleTooltip from "@/components/simple-tooltip"; import Image from "next/image"; +import { motion } from "framer-motion"; /** * The loader for the dashboard pages. @@ -11,6 +12,19 @@ import Image from "next/image"; * @return the loader jsx */ const DashboardLoader = (): ReactElement => { + const [showSupport, setShowSupport] = useState(false); + + /** + * Show the support section after + * 5 seconds of viewing this loader. + */ + useEffect(() => { + const timer = setTimeout(() => { + setShowSupport(true); + }, 5000); + return () => clearTimeout(timer); + }, []); + return (
{
{/* Support */} -
-

- Still can't connect? -

-
- {/* Status Page */} - - - - - - - {/* Discord */} - - - Discord Logo - - -
-
+ {showSupport && } ); }; + +const SupportSection = () => ( + +

+ Still can't connect? +

+
+ {/* Status Page */} + + + + + + + {/* Discord */} + + + Discord Logo + + +
+
+); + export default DashboardLoader;