diff --git a/usehooks.com/public/img/querygg/corner-fish-bottom-right.svg b/usehooks.com/public/img/querygg/corner-fish-bottom-right.svg deleted file mode 100644 index 21ca01c..0000000 --- a/usehooks.com/public/img/querygg/corner-fish-bottom-right.svg +++ /dev/null @@ -1 +0,0 @@ -three-eyed fish \ No newline at end of file diff --git a/usehooks.com/public/img/querygg/corner-top-left.svg b/usehooks.com/public/img/querygg/corner-top-left.svg deleted file mode 100644 index 5db5839..0000000 --- a/usehooks.com/public/img/querygg/corner-top-left.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/usehooks.com/public/img/querygg/corner-top-right.svg b/usehooks.com/public/img/querygg/corner-top-right.svg deleted file mode 100644 index 987be57..0000000 --- a/usehooks.com/public/img/querygg/corner-top-right.svg +++ /dev/null @@ -1 +0,0 @@ -moon with a face \ No newline at end of file diff --git a/usehooks.com/public/img/querygg/header-course.svg b/usehooks.com/public/img/querygg/header-course.svg deleted file mode 100644 index 959fedb..0000000 --- a/usehooks.com/public/img/querygg/header-course.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/usehooks.com/src/components/CountdownTimer.tsx b/usehooks.com/src/components/CountdownTimer.tsx deleted file mode 100644 index 2d612d9..0000000 --- a/usehooks.com/src/components/CountdownTimer.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { Fragment, useEffect, useState } from "react"; - -interface CountdownProps { - targetDate: string; // YYYY-MM-DD format -} - -interface TimeLeft { - days: number; - hours: number; - minutes: number; - seconds: number; -} - -function calculateTimeLeft(targetDate: string): TimeLeft { - const target = new Date(`${targetDate}T00:00:00-08:00`); - const now = new Date(); - const difference = +target - +now; - - if (difference <= 0) { - return { - days: 0, - hours: 0, - minutes: 0, - seconds: 0, - }; - } - - return { - days: Math.floor(difference / (1000 * 60 * 60 * 24)), - hours: Math.floor((difference / (1000 * 60 * 60)) % 24), - minutes: Math.floor((difference / 1000 / 60) % 60), - seconds: Math.floor((difference / 1000) % 60), - }; -} - -const formatNumber = (number: number) => number.toString().padStart(2, "0"); - -const Countdown: React.FC = ({ targetDate }) => { - const [timeLeft, setTimeLeft] = useState( - calculateTimeLeft(targetDate) - ); - - useEffect(() => { - const timer = setInterval(() => { - const newTimeLeft = calculateTimeLeft(targetDate); - setTimeLeft(newTimeLeft); - if ( - newTimeLeft.days === 0 && - newTimeLeft.hours === 0 && - newTimeLeft.minutes === 0 && - newTimeLeft.seconds === 0 - ) { - clearInterval(timer); - } - }, 1000); - - return () => clearInterval(timer); - }, [targetDate]); - - if ( - timeLeft.days === 0 && - timeLeft.hours === 0 && - timeLeft.minutes === 0 && - timeLeft.seconds === 0 - ) { - return null; - } - - return ( - - {["days", "hours", "minutes", "seconds"].map((unit, index) => ( - - {index > 0 && :} - - - {formatNumber(timeLeft[unit as keyof TimeLeft]).charAt(0)} - - - {formatNumber(timeLeft[unit as keyof TimeLeft]).charAt(1)} - - {unit} - - - ))} - - ); -}; - -export default Countdown; diff --git a/usehooks.com/src/components/QueryGGBanner.astro b/usehooks.com/src/components/QueryGGBanner.astro deleted file mode 100644 index 2965b98..0000000 --- a/usehooks.com/src/components/QueryGGBanner.astro +++ /dev/null @@ -1,61 +0,0 @@ ---- -import Button from "./Button.astro"; -import CountdownTimer from "./CountdownTimer"; ---- - - - - diff --git a/usehooks.com/src/pages/index.astro b/usehooks.com/src/pages/index.astro index 79a0229..d9846b7 100644 --- a/usehooks.com/src/pages/index.astro +++ b/usehooks.com/src/pages/index.astro @@ -5,7 +5,6 @@ import NavMain from "../sections/NavMain.astro"; import HomeHero from "../sections/HomeHero.astro"; import HooksList from "../components/search/HooksList"; import Footer from "../sections/Footer.astro"; -import QueryGGBanner from "../components/QueryGGBanner.astro"; const hooks = await getCollection("hooks"); --- @@ -14,7 +13,6 @@ const hooks = await getCollection("hooks"); title="useHooks – The React Hooks Library" description="A collection of modern, server-safe React hooks – from the ui.dev team" > -
{unit}