feat: add tg api
All checks were successful
Deploy to VPS (dist) / deploy (push) Successful in 1m35s
All checks were successful
Deploy to VPS (dist) / deploy (push) Successful in 1m35s
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { motion, type HTMLMotionProps } from "motion/react";
|
||||
import clsx, { type ClassValue } from "clsx";
|
||||
|
||||
import tg from "@/tg";
|
||||
|
||||
import classes from "./Button.module.css";
|
||||
|
||||
type Props = Omit<HTMLMotionProps<"button">, "className"> & {
|
||||
@@ -15,10 +17,14 @@ const VARIANTS_MAP = {
|
||||
yellow: classes.yellowButton,
|
||||
} satisfies Record<Exclude<Props["variant"], undefined>, string>;
|
||||
|
||||
export default function Button({ className, variant = "blue", ...props }: Props) {
|
||||
export default function Button({ className, variant = "blue", onClick, ...props }: Props) {
|
||||
return (
|
||||
<motion.button
|
||||
{...props}
|
||||
onClick={(e) => {
|
||||
tg.hapticFeedback.click();
|
||||
onClick?.(e);
|
||||
}}
|
||||
initial={{ scale: 0.5 }}
|
||||
animate={{ scale: 1 }}
|
||||
whileTap={{ scale: 0.95 }}
|
||||
|
||||
Reference in New Issue
Block a user