diff --git a/src/components/button.tsx b/src/components/button.tsx index c258447..e8a4bf5 100644 --- a/src/components/button.tsx +++ b/src/components/button.tsx @@ -4,7 +4,6 @@ import { useEffect, useState, } from "react"; -import { useSpring, animated, AnimatedComponent } from "react-spring"; interface ButtonProps extends ButtonHTMLAttributes { large?: boolean; @@ -14,56 +13,40 @@ interface ButtonProps extends ButtonHTMLAttributes { | ((e: React.MouseEvent) => Promise); } -const Button: AnimatedComponent> = animated( - ({ className, large, loading, children, onClick, style, ...props }) => { - const [clickLoading, setLoading] = useState(false); - const { angle } = useSpring({ - from: { - angle: 0, - }, - to: { - angle: 3600, - }, - loop: true, - config: { - easing: (t: number) => t, - duration: 3000, - }, - }); +const Button: FunctionComponent = ({ + className, + large, + loading, + children, + onClick, + style, + ...props +}) => { + const [clickLoading, setLoading] = useState(false); - return ( - - `linear-gradient(${a}deg, var(--primary), var(--secondary))` - ) - : "", - ...(style ?? {}), - color: loading || clickLoading ? `var(--primary-text)` : undefined, - }} - onClick={(e) => { - if (onClick) { - const result = onClick(e); - if (result instanceof Promise) { - setLoading(true); - result.finally(() => setLoading(false)); - } + return ( + + ); +}; export default Button; diff --git a/src/components/countdown.tsx b/src/components/countdown.tsx index 4438d7e..a42fd74 100644 --- a/src/components/countdown.tsx +++ b/src/components/countdown.tsx @@ -43,7 +43,7 @@ function Countdown(props: {
0 ? "border-l-0" : "" } ${i === 0 ? "rounded-tl rounded-bl" : ""} ${ i === 3 ? "rounded-tr rounded-br" : "" diff --git a/src/components/countup.tsx b/src/components/countup.tsx index 1b0ba3a..0764432 100644 --- a/src/components/countup.tsx +++ b/src/components/countup.tsx @@ -35,7 +35,7 @@ function Countup(props: {
0 ? "border-l-0" : "" } ${i === 0 ? "rounded-tl rounded-bl" : ""} ${ i === 3 ? "rounded-tr rounded-br" : "" diff --git a/src/components/quiz/overlay.tsx b/src/components/quiz/overlay.tsx deleted file mode 100644 index 641a816..0000000 --- a/src/components/quiz/overlay.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { FunctionComponent } from "react"; -import { animated, SpringValue } from "react-spring"; - -interface OverlayProps { - blur: SpringValue; -} - -const Overlay: FunctionComponent = ({ blur }) => { - return ( - { - const v = blur.to((v) => `blur(${v}px)`); - return { - backdropFilter: v, - WebkitBackdropFilter: v, - }; - })()} - className="absolute top-0 left-0 right-0 bottom-0 pointer-events-none" - > - ); -}; - -export default Overlay; diff --git a/src/components/quiz/questions/common.tsx b/src/components/quiz/questions/common.tsx index a079b34..71f7003 100644 --- a/src/components/quiz/questions/common.tsx +++ b/src/components/quiz/questions/common.tsx @@ -27,7 +27,7 @@ const CommonQuestion: FunctionComponent = ({ {question.answers!.map((answer, i, items) => (