feat: enhance theme handling and layout components for Telegram Mini App

- Updated theme resolution logic to utilize a shared inline script for consistent theme application across routes.
- Introduced `AppShell` and `ReadyGate` components to manage app readiness and theme synchronization, improving user experience.
- Enhanced `GlobalError` and `NotFound` pages with a unified full-screen layout for better accessibility and visual consistency.
- Refactored CSS to implement safe area insets for sticky headers and content safety, ensuring proper layout on various devices.
- Added unit tests for new functionality and improved existing tests for better coverage and reliability.
This commit is contained in:
2026-03-06 16:48:24 +03:00
parent 76bff6dc05
commit 40e2b5adc4
25 changed files with 396 additions and 131 deletions

View File

@@ -8,6 +8,7 @@
import { useTranslation } from "@/i18n/use-translation";
import { formatPhoneDisplay } from "@/lib/phone-format";
import { openPhoneLink } from "@/lib/open-phone-link";
import { openTelegramProfile } from "@/lib/telegram-link";
import { triggerHapticLight } from "@/lib/telegram-haptic";
import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
@@ -90,6 +91,11 @@ export function ContactLinks({
target="_blank"
rel="noopener noreferrer"
aria-label={ariaTelegram}
onClick={(e) => {
e.preventDefault();
openTelegramProfile(cleanUsername);
triggerHapticLight();
}}
>
<TelegramIcon className="size-5" aria-hidden />
<span>@{cleanUsername}</span>
@@ -131,6 +137,11 @@ export function ContactLinks({
}
if (hasUsername) {
const href = `https://t.me/${encodeURIComponent(cleanUsername)}`;
const handleTelegramClick = (e: React.MouseEvent<HTMLAnchorElement>) => {
e.preventDefault();
openTelegramProfile(cleanUsername);
triggerHapticLight();
};
const link = (
<a
key="tg"
@@ -139,6 +150,7 @@ export function ContactLinks({
rel="noopener noreferrer"
className={linkClass}
aria-label={ariaTelegram}
onClick={handleTelegramClick}
>
@{cleanUsername}
</a>