From c0c6b67710fa13951d2b4fa8b9f83acee7a9fc81 Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 25 Mar 2026 23:36:52 +0000 Subject: [PATCH] Update src/components/button/ButtonBounceEffect/ButtonBounceEffect.tsx --- .../ButtonBounceEffect/ButtonBounceEffect.tsx | 111 +++++++----------- 1 file changed, 43 insertions(+), 68 deletions(-) diff --git a/src/components/button/ButtonBounceEffect/ButtonBounceEffect.tsx b/src/components/button/ButtonBounceEffect/ButtonBounceEffect.tsx index 1df6162..2c75820 100644 --- a/src/components/button/ButtonBounceEffect/ButtonBounceEffect.tsx +++ b/src/components/button/ButtonBounceEffect/ButtonBounceEffect.tsx @@ -1,74 +1,49 @@ -"use client"; +import React, { forwardRef } from "react"; +import { cn } from "@/lib/utils"; +import { useButtonClick } from "@/components/button/useButtonClick"; +import { ButtonProps } from "@/components/button/button.types"; -import { useRef, memo } from "react"; -import { useCharAnimation } from "../useCharAnimation"; -import { useButtonClick } from "../useButtonClick"; -import { cls } from "@/lib/utils"; -import "./BounceButton.css"; +export const ButtonBounceEffect = forwardRef( + ( + { + text, + onClick, + href, + className, + bgClassName, + textClassName, + iconClassName, + disabled = false, + ariaLabel, + type = "button", newTab, + ...props + }, + ref + ) => { + const clickHandler = useButtonClick(href, onClick, newTab); -interface ButtonBounceEffectProps { - text: string; - onClick?: () => void; - href?: string; - className?: string; - bgClassName?: string; - textClassName?: string; - disabled?: boolean; - ariaLabel?: string; - type?: "button" | "submit" | "reset"; - scrollToSection?: boolean; -} - -const ButtonBounceEffect = ({ - text, - onClick, - href, - className = "", - bgClassName = "", - textClassName = "", - disabled = false, - ariaLabel, - type = "button", - scrollToSection, -}: ButtonBounceEffectProps) => { - const buttonRef = useRef(null); - const handleClick = useButtonClick(href, onClick, scrollToSection); - - useCharAnimation(buttonRef, text); - - return ( - - ); -}; + + {text} + + + ); + } +); ButtonBounceEffect.displayName = "ButtonBounceEffect"; - -export default memo(ButtonBounceEffect);