From 0d1ac3ffffaeb0fccbf76e5984c268d5e1556448 Mon Sep 17 00:00:00 2001 From: wont-stream Date: Wed, 29 Jan 2025 18:48:13 -0500 Subject: [PATCH] Remove Countdown component and associated styles --- src/components/Countdown/IconAnchor.css | 16 ---------------- src/components/Countdown/index.tsx | 18 ------------------ 2 files changed, 34 deletions(-) delete mode 100644 src/components/Countdown/IconAnchor.css delete mode 100644 src/components/Countdown/index.tsx diff --git a/src/components/Countdown/IconAnchor.css b/src/components/Countdown/IconAnchor.css deleted file mode 100644 index a2b07ba..0000000 --- a/src/components/Countdown/IconAnchor.css +++ /dev/null @@ -1,16 +0,0 @@ -.IconAnchor { - margin: 5px; -} - -a { - color: #dcdcdc; - text-decoration: none; -} - -a:hover { - color: #808080; -} - -a:active { - color: #a9a9a9; -} diff --git a/src/components/Countdown/index.tsx b/src/components/Countdown/index.tsx deleted file mode 100644 index 3afbe7d..0000000 --- a/src/components/Countdown/index.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { useState, useEffect } from "preact/hooks"; - -// biome-ignore lint/complexity/noBannedTypes: -export default (props: { timeInSeconds: number, callBack?: Function }) => { - const [timeLeft, setTimeLeft] = useState(props.timeInSeconds * 1000); // Convert to milliseconds - - useEffect(() => { - if (timeLeft <= 1) return props?.callBack?.(); - - const timer = setInterval(() => { - setTimeLeft((prev) => prev - 1); // Decrease by 1ms - }, 0); - - return () => clearInterval(timer); - }, [timeLeft, props?.callBack]); - - return
{timeLeft}ms remaining
; - }; \ No newline at end of file