feat: enhance CSS and components for Telegram Mini App performance
- Updated CSS to utilize viewport variables for safe area insets and stable height, improving layout consistency across devices. - Introduced haptic feedback triggers in various components to enhance user interaction, mimicking native Telegram behavior. - Added functionality to detect Android performance class, minimizing animations on low-performance devices for better user experience. - Refactored components to incorporate new CSS classes for content safety and improved responsiveness.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
import { useTranslation } from "@/i18n/use-translation";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { triggerHapticLight } from "@/lib/telegram-haptic";
|
||||
|
||||
export interface ErrorStateProps {
|
||||
/** Error message to display. If not provided, uses generic i18n message. */
|
||||
@@ -65,7 +66,10 @@ export function ErrorState({ message, onRetry, className }: ErrorStateProps) {
|
||||
variant="default"
|
||||
size="sm"
|
||||
className="mt-1 bg-primary text-primary-foreground hover:opacity-90 focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2"
|
||||
onClick={onRetry}
|
||||
onClick={() => {
|
||||
triggerHapticLight();
|
||||
onRetry();
|
||||
}}
|
||||
>
|
||||
{t("error.retry")}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user