feat: add tg api
All checks were successful
Deploy to VPS (dist) / deploy (push) Successful in 1m35s

This commit is contained in:
Hewston Fox
2026-03-16 00:50:53 +02:00
parent 67c2721cff
commit 9f0ff8c4e5
29 changed files with 544 additions and 40 deletions

View File

@@ -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 }}