-
+
diff --git a/src/components/footer/SocialIcon.tsx b/src/components/footer/SocialIcon.tsx
index 03a0483..0201a95 100644
--- a/src/components/footer/SocialIcon.tsx
+++ b/src/components/footer/SocialIcon.tsx
@@ -1,11 +1,10 @@
import React from "react";
import { Button } from "../ui/button";
import Link from "next/link";
-import { IconType } from "@icons-pack/react-simple-icons";
interface SocialIconProps {
href: string;
- Icon: IconType;
+ Icon: React.ElementType;
}
const SocialIcon = ({ href, Icon }: SocialIconProps) => {
diff --git a/src/components/form/form-fields.tsx b/src/components/form/form-fields.tsx
index a49be76..f409219 100644
--- a/src/components/form/form-fields.tsx
+++ b/src/components/form/form-fields.tsx
@@ -55,7 +55,7 @@ export const Textarea = forwardRef
(functi
);
});
-export const Checkbox = forwardRef(function Checkbox(
+export const Checkbox = forwardRef(function Checkbox(
{ label, ...props },
ref
) {
diff --git a/src/components/navbar/ThemeButton.tsx b/src/components/navbar/ThemeButton.tsx
index 4fe9fcb..3229a59 100644
--- a/src/components/navbar/ThemeButton.tsx
+++ b/src/components/navbar/ThemeButton.tsx
@@ -12,6 +12,7 @@ interface ThemeButtonProps {
const ThemeButton = ({ className }: ThemeButtonProps) => {
const { resolvedTheme, setTheme } = useTheme();
const [mounted, setMounted] = useState(false);
+ // eslint-disable-next-line react-hooks/set-state-in-effect
useEffect(() => setMounted(true), []);
return (
diff --git a/src/components/ui/alert-banner.tsx b/src/components/ui/alert-banner.tsx
index 0e52d05..76d76de 100644
--- a/src/components/ui/alert-banner.tsx
+++ b/src/components/ui/alert-banner.tsx
@@ -13,7 +13,7 @@ interface AlertBannerProps {
linkText?: string;
}
-function AlertBanner({
+async function AlertBanner({
id,
expirationDate,
hideOnMobile,
@@ -22,16 +22,18 @@ function AlertBanner({
text,
url,
}: AlertBannerProps) {
- const cookieStore = cookies();
+ const cookieStore = await cookies();
const dismissalCookieId = `dismiss_banner_${id}`;
+ // eslint-disable-next-line react-hooks/purity
+ const now = Date.now();
const isShown =
!cookieStore.get(dismissalCookieId) &&
- (!expirationDate || expirationDate.getTime() > Date.now());
+ (!expirationDate || expirationDate.getTime() > now);
async function dismissBanner(dismissalCookieId: string) {
"use server";
- cookies().set(dismissalCookieId, "true", {
+ (await cookies()).set(dismissalCookieId, "true", {
expires: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000),
});
}
diff --git a/src/components/ui/animated-number.tsx b/src/components/ui/animated-number.tsx
index c278142..1f3e63d 100644
--- a/src/components/ui/animated-number.tsx
+++ b/src/components/ui/animated-number.tsx
@@ -4,18 +4,19 @@ import { motion, useInView, useSpring, useTransform } from "framer-motion";
import { useEffect, useRef } from "react";
function AnimatedNumber({ value }: { value: number }) {
- if (value === undefined) {
- return ;
- }
- const nodeRef = useRef() as React.MutableRefObject;
+ const nodeRef = useRef(null);
const inView = useInView(nodeRef, { once: true });
const spring = useSpring(0, { mass: 0.8, stiffness: 75, damping: 22 });
const display = useTransform(spring, (current) => Math.round(current).toLocaleString());
useEffect(() => {
- if (inView) spring.set(value);
+ if (inView && value !== undefined) spring.set(value);
}, [spring, value, inView]);
+ if (value === undefined) {
+ return ;
+ }
+
return (
{!!state.hasTime && (
-
+ {
+ if (value) state.setTimeValue(value);
+ }}
+ />
)}
diff --git a/src/components/ui/hover-card.tsx b/src/components/ui/hover-card.tsx
index f4e109b..8b71c60 100644
--- a/src/components/ui/hover-card.tsx
+++ b/src/components/ui/hover-card.tsx
@@ -5,11 +5,9 @@ import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
import { cn } from "@/lib/utils";
-const HoverCard = React.forwardRef<
- React.ElementRef