feat: Linear-style UI redesign with improved mobile experience

Major changes:
- Redesign cabinet with Linear-style components and top navigation
- Replace detail modals with dedicated pages (users, broadcasts, email templates)
- Add email channel support for broadcasts
- Remove pull-to-refresh, improve drag-and-drop on touch devices
- Fix Telegram Mini App: fullscreen, back button, scroll restoration
- Unify admin pages color scheme to design system
- Mobile-first improvements: horizontal tabs for settings, better touch targets
This commit is contained in:
c0mrade
2026-01-31 22:06:36 +03:00
parent 929634aac4
commit b953ee0b8c
108 changed files with 11711 additions and 4542 deletions

View File

@@ -0,0 +1,43 @@
import { useMemo, type ReactNode } from 'react';
import { PlatformContext } from '@/platform/PlatformContext';
import { createTelegramAdapter } from '@/platform/adapters/TelegramAdapter';
import { createWebAdapter } from '@/platform/adapters/WebAdapter';
import type { PlatformContext as PlatformContextType } from '@/platform/types';
interface PlatformProviderProps {
children: ReactNode;
}
function detectPlatform(): 'telegram' | 'web' {
// Check if Telegram WebApp is available and actually initialized with data
// initData is an empty string when not in real Telegram context
if (
typeof window !== 'undefined' &&
window.Telegram?.WebApp?.initData &&
window.Telegram.WebApp.initData.length > 0
) {
return 'telegram';
}
return 'web';
}
function createAdapter(): PlatformContextType {
const platform = detectPlatform();
if (platform === 'telegram') {
return createTelegramAdapter();
}
return createWebAdapter();
}
export function PlatformProvider({ children }: PlatformProviderProps) {
// Create adapter once on mount
// Using useMemo to ensure stable reference
const platformContext = useMemo(() => createAdapter(), []);
return <PlatformContext.Provider value={platformContext}>{children}</PlatformContext.Provider>;
}
// Re-export types for convenience
export type { PlatformContextType as PlatformContext };