mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
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:
@@ -1,8 +1,10 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useEffect, useCallback } from 'react';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { themeColorsApi } from '../api/themeColors';
|
||||
import { DEFAULT_THEME_COLORS } from '../types/theme';
|
||||
import { applyThemeColors } from '../hooks/useThemeColors';
|
||||
import { usePlatform } from '@/platform';
|
||||
import { useTheme } from '../hooks/useTheme';
|
||||
|
||||
interface ThemeColorsProviderProps {
|
||||
children: React.ReactNode;
|
||||
@@ -17,10 +19,30 @@ export function ThemeColorsProvider({ children }: ThemeColorsProviderProps) {
|
||||
retry: 1,
|
||||
});
|
||||
|
||||
const { theme: platformTheme, capabilities } = usePlatform();
|
||||
const { isDark } = useTheme();
|
||||
|
||||
// Apply colors on mount and when they change
|
||||
useEffect(() => {
|
||||
applyThemeColors(colors || DEFAULT_THEME_COLORS);
|
||||
}, [colors]);
|
||||
|
||||
// Sync Telegram header and bottom bar colors with theme
|
||||
const syncTelegramColors = useCallback(() => {
|
||||
if (!capabilities.hasThemeSync) return;
|
||||
|
||||
const themeColors = colors || DEFAULT_THEME_COLORS;
|
||||
// Use surface color for header/bottom bar to match app UI
|
||||
const headerColor = isDark ? themeColors.darkSurface : themeColors.lightSurface;
|
||||
|
||||
platformTheme.setHeaderColor(headerColor);
|
||||
platformTheme.setBottomBarColor(headerColor);
|
||||
}, [capabilities.hasThemeSync, colors, isDark, platformTheme]);
|
||||
|
||||
// Apply Telegram colors when theme or colors change
|
||||
useEffect(() => {
|
||||
syncTelegramColors();
|
||||
}, [syncTelegramColors]);
|
||||
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user