Commit Graph

275 Commits

Author SHA1 Message Date
c0mrade
65a671470d feat: use app-level svgIconKey for app logos and improve tile contrast
- Add svgIconKey field to RemnawaveAppClient and RemnawaveApp types
- Render app logos from svgLibrary via app.svgIconKey on connection page
  chips with fallback to getAppIcon() by name
- Use app.svgIconKey for app icons on admin apps settings page
- Show featured indicator as amber dot matching original RemnaWave UI
- Increase inner tile background opacity from 30% to 50% on subscription
  page for better text readability
2026-02-05 11:27:03 +03:00
c0mrade
445dd0601a feat: convert ConnectionModal to /connection page with crypto deep links
- Add @kastov/cryptohapp + jsencrypt for encrypted Happ deep links
- Add templateEngine utility to resolve {{SUBSCRIPTION_LINK}},
  {{HAPP_CRYPT3_LINK}}, {{HAPP_CRYPT4_LINK}}, {{USERNAME}} templates
- Convert ConnectionModal component into a standalone Connection page
- Add /connection route with ProtectedRoute and lazy loading
- Replace modal invocation in Dashboard and Subscription with
  navigate('/connection')
- Add type and svgIconKey optional fields to RemnawaveButton
- Show button type badge and SVG icon in AdminApps BlockCard
- Refactor ThemeTab to use local draft state with Save/Cancel flow
2026-02-05 07:33:45 +03:00
Fringg
46b93ef098 fix(subscription): display promo group discounts in device/traffic purchase and tariff switch
- Add discount fields to TrafficPackage and TariffSwitchPreview types
- Show strikethrough original price and discount badge for device purchase
- Show discount badge and original price for traffic packages
- Show discount info and free label for tariff switch with 100% discount
2026-02-05 06:26:27 +03:00
c0mrade
023c3ef6b3 refactor: migrate to @telegram-apps/sdk-react v3, remove all window.Telegram.WebApp usage
Полный переход с нативного window.Telegram.WebApp API на @telegram-apps/sdk-react v3.
Bridge SDK оборачивал receiveEvent, из-за чего popup_closed не доходил до нативного
обработчика — это было основной причиной бага с двойным открытием попапа.

Изменения:

- Удалён @telegram-apps/react-router-integration (привязан к SDK v1)
- Инициализация SDK v3 в main.tsx: init(), restoreInitData(), mount всех компонентов
- AppWithNavigator: убран TelegramRouter (initNavigator + useIntegration), все платформы
  на BrowserRouter, добавлен TelegramBackButton через SDK v3
- useTelegramSDK: детекция через retrieveLaunchParams(), реактивные значения через
  useSignal() (fullscreen, viewport, safe area insets), initData через retrieveRawInitData()
- TelegramAdapter: полная перезапись — попапы через showPopup() (Promise-based, без
  ручного onEvent/offEvent/timeout), кнопки через setMainButtonParams/showBackButton,
  haptic через hapticFeedbackImpactOccurred, тема через themeParamsState с конвертацией
  camelCase→snake_case, cloud storage через getCloudStorageItem/setCloudStorageItem
- api/client.ts: initData через retrieveRawInitData() вместо window.Telegram.WebApp.initData
- AppHeader: фото пользователя через initDataUser() сигнал
- ConnectionModal: openLink через SDK вместо window.Telegram.WebApp.openLink
- ColorPicker: детекция Telegram через isInTelegramWebApp()
- Удалён интерфейс TelegramWebApp (368 строк) и Window augmentation из vite-env.d.ts
- Убрано поле telegram из PlatformContext в types.ts
- Обновлён manualChunks в vite.config.ts
2026-02-04 11:06:59 +03:00
c0mrade
55e2068606 Fix back button cycling in Telegram Mini App
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
2026-02-04 05:59:15 +03:00
c0mrade
e4b35ae0ad Merge main branch changes 2026-02-04 05:03:21 +03:00
Egor
f89573a1f3 Update promo.ts 2026-02-04 04:56:05 +03:00
c0mrade
9042603e67 Move payment method editing to separate page and fix auth error handling
- 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
2026-02-04 03:39:38 +03:00
c0mrade
c8c9920ade Merge remote-tracking branch 'origin/main' into feat/linear-ui-redesign
# Conflicts:
#	src/components/PromoDiscountBadge.tsx
2026-02-04 03:25:35 +03:00
Egor
8c9b161b58 Update promo.ts 2026-02-04 02:09:31 +03:00
c0mrade
f147c10a25 Merge remote-tracking branch 'origin/main' into feat/linear-ui-redesign
# Conflicts:
#	src/pages/AdminUsers.tsx
2026-02-03 21:48:38 +03:00
Egor
eae12e2694 Update adminUsers.ts 2026-02-03 04:39:13 +03:00
c0mrade
d6edb659a3 refactor: align tariff builder with bot functionality
- Remove unused fields: custom_days, custom_traffic (bot doesn't use them)
- Add promo groups selection to tariff form
- Add API endpoint for fetching available promo groups
- Make traffic topup packages dynamic (add/remove any number)
- Fix stuck 0 in number inputs when clearing
- Add validation messages explaining why save button is blocked
- Match bot validation: name 2-50 chars, device_limit >= 1, tier_level 1-10
- Add missing i18n translations for new fields and validation errors
2026-02-02 04:27:52 +03:00
c0mrade
edb5be09ae feat: migrate to @tma.js/sdk-react for Telegram Mini App
- Add useTelegramSDK hook with reactive signals for viewport, safe area, fullscreen
- Migrate TelegramAdapter to use SDK components (backButton, mainButton, hapticFeedback, cloudStorage, themeParams, popup)
- Update Login, TelegramRedirect to use SDK helpers
- Update PlatformProvider, api/client to use centralized SDK functions
- Simplify useTelegramWebApp as backward-compatible wrapper
- Add automatic CSS variable binding for theme and viewport
2026-02-01 20:13:50 +03:00
Egor
92905770e4 Update subscription.ts 2026-02-01 17:21:03 +03:00
Egor
b1eea1860c Update subscription.ts 2026-01-31 20:55:41 +03:00
Egor
391c42ec60 Update subscription.ts 2026-01-31 20:48:36 +03:00
Egor
01e3c7b042 Update subscription.ts 2026-01-31 20:31:01 +03:00
Egor
9a1d02614c Update adminUsers.ts 2026-01-31 20:13:44 +03:00
Egor
8f72d9f831 Update adminBroadcasts.ts 2026-01-31 18:02:39 +03:00
Egor
2f1083d005 Update auth.ts 2026-01-30 15:52:51 +03:00
Egor
660f2295ba Update subscription.ts 2026-01-29 01:03:46 +03:00
Egor
2722fca22e Update subscription.ts 2026-01-28 20:34:46 +03:00
c0mrade
9707ad97a4 feat(i18n): migrate all hardcoded Russian text to i18n
- Replace all hardcoded Russian strings with t() calls across 30+ files
- Add ~500 new translation keys to all 4 locales (ru, en, zh, fa)
- Convert module-level config objects to labelKey pattern
- Remove Russian fallbacks from t() calls (fallbackLng handles it)
- Replace DeepLinkRedirect custom i18n with standard t() calls
- Fix subscription.servers key collision (string vs object)
2026-01-27 22:19:41 +03:00
c0mrade
bc90ba3779 refactor: migrate to eslint flat config and format codebase with prettier
- Remove legacy .eslintrc.cjs and .eslintignore
- Add eslint.config.js with flat config, security rules (no-eval, no-implied-eval, no-new-func, no-script-url)
- Add .prettierrc and .prettierignore
- Format entire codebase with prettier
2026-01-27 17:37:31 +03:00
Egor
1695247974 Update branding.ts 2026-01-27 01:19:05 +03:00
Egor
de06767306 Add files via upload 2026-01-26 22:39:11 +03:00
Egor
3126b1bf8c Add files via upload 2026-01-26 21:59:06 +03:00
Egor
29af2be21c Update branding.ts 2026-01-25 09:46:05 +03:00
Egor
cb1476f808 Update auth.ts 2026-01-25 09:25:27 +03:00
Egor
9688fc5581 Update auth.ts 2026-01-25 08:46:14 +03:00
Egor
3a5034cb1e Add files via upload 2026-01-23 11:34:14 +03:00
Egor
9ef89bf585 Update promoOffers.ts 2026-01-22 23:09:30 +03:00
Egor
7ae5411006 Update branding.ts 2026-01-21 08:42:02 +03:00
Egor
793dc51a9c Update promo.ts 2026-01-21 08:13:25 +03:00
Egor
5930de6275 Update client.ts 2026-01-20 14:40:13 +03:00
Egor
b7fd893697 Update client.ts 2026-01-20 14:29:39 +03:00
Egor
fe9e28dbb7 Update subscription.ts 2026-01-20 06:38:25 +03:00
Egor
2dad001591 Update subscription.ts 2026-01-20 05:40:50 +03:00
PEDZEO
64acfbee72 Add fullscreen functionality: introduce API methods for getting and updating fullscreen settings, implement caching for fullscreen state, and integrate fullscreen toggle in AdminSettings. Remove unused fullscreen icons from Layout component. 2026-01-20 02:17:22 +03:00
PEDZEO
0039a8a9b3 Implement logo preloading on page load and enhance branding image display with fade-in effect 2026-01-19 23:36:05 +03:00
Egor
e53d805bef Update branding.ts 2026-01-19 10:31:50 +03:00
Egor
02303bdff9 Update branding.ts 2026-01-19 10:19:04 +03:00
Egor
af5d8645a1 Update promocodes.ts 2026-01-19 09:32:42 +03:00
Egor
707f3e3aba Update admin.ts 2026-01-19 09:14:08 +03:00
PEDZEO
638f1d5456 Refactor Dockerfile and Vite configuration to remove VITE_APP_VERSION and streamline build process
- Removed VITE_APP_VERSION from Dockerfile and GitHub workflows.
- Simplified Vite configuration by eliminating the Git version retrieval function and global constant for app version.
- Updated ColorPicker and other components to enhance accessibility with aria-labels.
- Introduced unique identifiers for buttons in the AppEditorModal for better React key management.
- Improved error handling in the Login component to provide user-friendly messages without exposing sensitive data.
2026-01-19 07:39:09 +03:00
PEDZEO
acfebd7878 Refactor getAdminNotifications to streamline parameter handling for API requests, improving readability and maintainability. 2026-01-19 01:31:29 +03:00
PEDZEO
35ee63b351 Add ticket notification system with user and admin notification settings; integrate ToastProvider in main app layout 2026-01-19 00:24:13 +03:00
PEDZEO
3d34f3f1c9 Merge branch 'main' from bedolaga 2026-01-18 07:02:14 +03:00
Egor
71587075c4 Update client.ts 2026-01-18 06:27:59 +03:00