feat: add news section with admin editor and public article view

- NewsSection with animated grid background, category filters, featured cards
- AdminNews list page with toggle publish/featured, pagination
- AdminNewsCreate with TipTap rich text editor, URL validation
- NewsArticle detail page with DOMPurify sanitization, Telegram back button
- Toggle component with WCAG 44px touch targets, role=switch
- Prose styles for highlight marks and responsive iframes
- i18n translations (en, ru, zh, fa)
This commit is contained in:
Fringg
2026-03-23 10:49:46 +03:00
parent 5b12784ab8
commit 99fc33625e
17 changed files with 7750 additions and 70 deletions

View File

@@ -117,6 +117,11 @@ const AdminLandingEditor = lazy(() => import('./pages/AdminLandingEditor'));
const AdminLandingStats = lazy(() => import('./pages/AdminLandingStats'));
const AdminReferralNetwork = lazy(() => import('./pages/ReferralNetwork'));
// News pages
const NewsArticlePage = lazy(() => import('./pages/NewsArticle'));
const AdminNews = lazy(() => import('./pages/AdminNews'));
const AdminNewsCreate = lazy(() => import('./pages/AdminNewsCreate'));
function ProtectedRoute({
children,
withLayout = true,
@@ -478,6 +483,16 @@ function App() {
</ProtectedRoute>
}
/>
<Route
path="/news/:slug"
element={
<ProtectedRoute>
<LazyPage>
<NewsArticlePage />
</LazyPage>
</ProtectedRoute>
}
/>
{/* Admin routes */}
<Route
@@ -1162,6 +1177,38 @@ function App() {
</PermissionRoute>
}
/>
{/* News admin routes */}
<Route
path="/admin/news"
element={
<PermissionRoute permission="news:read">
<LazyPage>
<AdminNews />
</LazyPage>
</PermissionRoute>
}
/>
<Route
path="/admin/news/create"
element={
<PermissionRoute permission="news:create">
<LazyPage>
<AdminNewsCreate />
</LazyPage>
</PermissionRoute>
}
/>
<Route
path="/admin/news/:id/edit"
element={
<PermissionRoute permission="news:edit">
<LazyPage>
<AdminNewsCreate />
</LazyPage>
</PermissionRoute>
}
/>
<Route
path="/admin/audit-log"
element={