Add replace: true to all navigate() calls in useBackButton hooks
Prevents history cycles when navigating back and forth
All 32 admin pages now use navigate(path, { replace: true })
Back button now goes directly to parent without cycling
Main sections navigate to /admin (15 pages)
Detail/edit pages navigate to parent lists (16 pages)
All pages use useBackButton hook with proper navigation paths
Native Telegram back button in Mini App, UI button on web
Email template pages keep UI-only back buttons as required
Replace desktop-style back button with native Telegram BackButton API:
- Use useBackButton hook for Telegram Mini App
- Show UI back button only on web (when !capabilities.hasBackButton)
- Improves native feel in Telegram environment
Payment methods drag-and-drop fixes:
- Restore original working drag-and-drop from commit 84c6d26
- Use position: relative instead of opacity for dragged items
- Remove closestCenter collision detection
- Use PointerSensor with distance: 5 without TouchSensor
- Restore touch-none and responsive padding on drag handles
- Restore original shadow and background colors
Promo deactivation feature:
- Add deactivation button to active discount banner in PromoOffersSection
- Use Telegram native popup (showPopup) in Mini App environment
- Fallback to modal for web browsers
- Add confirmation modal with warning about permanent action
- Integrate with useTelegramSDK for proper platform detection
Refactor to resolve react-refresh/only-export-components warnings:
- Move buttonVariants export to separate file (Button.variants.ts)
- Extract WebSocketContext to dedicated context file
- Move useWebSocketContext hook to separate file
- Update imports across affected files
All component files now export only components, improving fast refresh reliability
- Replace modal with dedicated AdminPaymentMethodEdit page
- Add route /admin/payment-methods/:methodId/edit
- Fix 401 error handling for auth endpoints to show error messages instead of reloading page
- Update client.ts to use window.Telegram.WebApp.initData directly
- Maintain useTelegramDnd for drag and drop functionality
- Allow multiple prize reorders before saving by using current displayed order
- Simplify lights pattern calculation using distance-based logic
- Fixes: drag only worked once, lights appeared to go through wheel
- Remove auto-save on drag-and-drop (prevents UI jumps)
- Store prize order changes locally
- Show warning banner with unsaved changes
- Add Save and Cancel buttons
- Only trigger API call when user clicks Save
- Add translations for unsaved order messages
- Fix lights animation to run continuously (even when idle)
- Lights now move sequentially around the circle
- Remove text labels from wheel, keep only emoji
- Add WheelLegend component with color indicators
- Display legend on right (desktop) and bottom (mobile)
- Add 'prizes' translation key for all languages
- Russian: add _one/_few/_many forms for proper declension
- English: add _one/_other forms for singular/plural
- Chinese: add _other form (no plural changes in Chinese)
- Farsi: add _other form (no plural changes in Farsi)
Fixed plural forms for:
- purchaseCount, registrations, subscriptions, tariffs
- device limits, members, hours, templates
- offers, notifications, promocodes, groups
- showMore and other count-based strings
- Stack name and username vertically on mobile
- Move Telegram ID to separate line
- Make status badges wrap when needed
- Reduce font sizes and spacing on small screens
- Hide purchase count on mobile
- Hide chevron icon on mobile, keep only action menu
- Improve wheel rotation animation with accumulated rotation tracking
- Enhance LED lights with running animation effect
- Replace sidebar history with collapsible section
- Unify spin button for all payment methods
- Update admin prize card styles with new borders and backgrounds
- Add improved drag-and-drop collision detection
- Prefer Telegram Stars payment in Mini App by default
Wheel.tsx (user page):
- Always show history sidebar on desktop
- Show placeholder when no history
- Remove history toggle button
AdminWheel.tsx:
- Replace auto-save with form + Save button
- Fix toggle switch styling
- Replace HTML5 drag-drop with @dnd-kit for mobile/Telegram
- Improve mobile responsiveness (tabs, cards, buttons)
- Add live wheel preview on desktop
- Group settings into sections
FortuneWheel.tsx:
- Slow down LED animation (250ms -> 600ms)
Navigation:
- Add wheel to mobile bottom nav (replaces Support when enabled)
- Add wheel button to mobile bottom nav (replaces Support when enabled)
- Slow down LED lights animation (250ms -> 600ms)
- Replace result modal with inline card in Wheel.tsx
- Add haptic feedback on spin result
- AdminWheel.tsx: inline prize editing instead of modal
- AdminWheel.tsx: drag-and-drop for prize reordering
- AdminWheel.tsx: live wheel preview on desktop
- AdminWheel.tsx: group settings into sections
- Replace confirm() with native dialog
- Add translations for all languages