show the support section in the dashboard loader after 5 seconds
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m1s

This commit is contained in:
Braydon 2024-09-19 03:35:48 -04:00
parent 673eb8c313
commit 495cc49c84

@ -1,9 +1,10 @@
import { ReactElement } from "react"; import { ReactElement, useEffect, useState } from "react";
import Branding from "@/components/branding"; import Branding from "@/components/branding";
import { ArrowPathIcon, ChartBarSquareIcon } from "@heroicons/react/24/outline"; import { ArrowPathIcon, ChartBarSquareIcon } from "@heroicons/react/24/outline";
import Link from "next/link"; import Link from "next/link";
import SimpleTooltip from "@/components/simple-tooltip"; import SimpleTooltip from "@/components/simple-tooltip";
import Image from "next/image"; import Image from "next/image";
import { motion } from "framer-motion";
/** /**
* The loader for the dashboard pages. * The loader for the dashboard pages.
@ -11,6 +12,19 @@ import Image from "next/image";
* @return the loader jsx * @return the loader jsx
*/ */
const DashboardLoader = (): ReactElement => { const DashboardLoader = (): ReactElement => {
const [showSupport, setShowSupport] = useState<boolean>(false);
/**
* Show the support section after
* 5 seconds of viewing this loader.
*/
useEffect(() => {
const timer = setTimeout(() => {
setShowSupport(true);
}, 5000);
return () => clearTimeout(timer);
}, []);
return ( return (
<div <div
className="absolute w-screen h-screen flex flex-col justify-center items-center select-none" className="absolute w-screen h-screen flex flex-col justify-center items-center select-none"
@ -31,7 +45,19 @@ const DashboardLoader = (): ReactElement => {
</div> </div>
{/* Support */} {/* Support */}
<div className="absolute bottom-7 flex flex-col gap-1.5"> {showSupport && <SupportSection />}
</div>
);
};
const SupportSection = () => (
<motion.div
className="absolute bottom-7 flex flex-col gap-1.5"
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: 10 }}
transition={{ duration: 0.3 }}
>
<p className="opacity-75 pointer-events-none"> <p className="opacity-75 pointer-events-none">
Still can&apos;t connect? Still can&apos;t connect?
</p> </p>
@ -55,8 +81,7 @@ const DashboardLoader = (): ReactElement => {
</Link> </Link>
</SimpleTooltip> </SimpleTooltip>
</div> </div>
</div> </motion.div>
</div> );
);
};
export default DashboardLoader; export default DashboardLoader;