feat: extract promocodes and promo groups into separate pages

- Add AdminPromocodeCreate page for creating/editing promocodes
- Add AdminPromoGroups page for listing discount groups
- Add AdminPromoGroupCreate page for creating/editing discount groups
- Move promo groups from Promocodes section to separate admin section
- Simplify AdminPromocodes by removing embedded modals and groups tab
- Add routes and navigation for new pages
- Add i18n keys for all 4 locales (ru, en, zh, fa)
This commit is contained in:
c0mrade
2026-02-02 05:40:25 +03:00
parent 0b4c75d7f7
commit a96ddde314
10 changed files with 1536 additions and 1015 deletions

View File

@@ -41,6 +41,9 @@ const AdminBanSystem = lazy(() => import('./pages/AdminBanSystem'));
const AdminBroadcasts = lazy(() => import('./pages/AdminBroadcasts'));
const AdminBroadcastCreate = lazy(() => import('./pages/AdminBroadcastCreate'));
const AdminPromocodes = lazy(() => import('./pages/AdminPromocodes'));
const AdminPromocodeCreate = lazy(() => import('./pages/AdminPromocodeCreate'));
const AdminPromoGroups = lazy(() => import('./pages/AdminPromoGroups'));
const AdminPromoGroupCreate = lazy(() => import('./pages/AdminPromoGroupCreate'));
const AdminCampaigns = lazy(() => import('./pages/AdminCampaigns'));
const AdminCampaignCreate = lazy(() => import('./pages/AdminCampaignCreate'));
const AdminUsers = lazy(() => import('./pages/AdminUsers'));
@@ -370,6 +373,56 @@ function App() {
</AdminRoute>
}
/>
<Route
path="/admin/promocodes/create"
element={
<AdminRoute>
<LazyPage>
<AdminPromocodeCreate />
</LazyPage>
</AdminRoute>
}
/>
<Route
path="/admin/promocodes/:id/edit"
element={
<AdminRoute>
<LazyPage>
<AdminPromocodeCreate />
</LazyPage>
</AdminRoute>
}
/>
<Route
path="/admin/promo-groups"
element={
<AdminRoute>
<LazyPage>
<AdminPromoGroups />
</LazyPage>
</AdminRoute>
}
/>
<Route
path="/admin/promo-groups/create"
element={
<AdminRoute>
<LazyPage>
<AdminPromoGroupCreate />
</LazyPage>
</AdminRoute>
}
/>
<Route
path="/admin/promo-groups/:id/edit"
element={
<AdminRoute>
<LazyPage>
<AdminPromoGroupCreate />
</LazyPage>
</AdminRoute>
}
/>
<Route
path="/admin/campaigns"
element={