v0.1 - макет интерфейса, аутентификация через логин, аккаунт админа, создание партии в 2 этапа, базовые настройки профиля и группы, переключение между группами, статистика
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { QueryClient } from "@tanstack/react-query";
|
||||
|
||||
export const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
retry: false,
|
||||
refetchOnWindowFocus: false,
|
||||
staleTime: 30_000,
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,68 @@
|
||||
import { Navigate, createBrowserRouter } from "react-router-dom";
|
||||
|
||||
import { AppShell } from "../components/AppShell";
|
||||
import { RequireAdmin, RequireAuth, RequireGroup } from "../auth/guards";
|
||||
import { AccountPage } from "../pages/AccountPage";
|
||||
import { CreateMatchPage } from "../pages/CreateMatchPage";
|
||||
import { GroupPage } from "../pages/GroupPage";
|
||||
import { GroupSettingsPage } from "../pages/GroupSettingsPage";
|
||||
import { HomePage } from "../pages/HomePage";
|
||||
import { LoginPage } from "../pages/LoginPage";
|
||||
import { MatchDetailPage } from "../pages/MatchDetailPage";
|
||||
import { AdminAccountsPage } from "../pages/admin/AdminAccountsPage";
|
||||
import { AdminFactionsPage } from "../pages/admin/AdminFactionsPage";
|
||||
import { AdminLayout } from "../pages/admin/AdminLayout";
|
||||
import { AdminLogsPage } from "../pages/admin/AdminLogsPage";
|
||||
import { AdminLoginPage } from "../pages/admin/AdminLoginPage";
|
||||
import { AdminRecordsPage } from "../pages/admin/AdminRecordsPage";
|
||||
|
||||
export const router = createBrowserRouter([
|
||||
{ path: "/login", element: <LoginPage /> },
|
||||
{ path: "/admin/login", element: <AdminLoginPage /> },
|
||||
{
|
||||
path: "/",
|
||||
element: (
|
||||
<RequireAuth>
|
||||
<AppShell />
|
||||
</RequireAuth>
|
||||
),
|
||||
children: [
|
||||
{ index: true, element: <HomePage /> },
|
||||
{
|
||||
path: "match/new",
|
||||
element: (
|
||||
<RequireGroup>
|
||||
<CreateMatchPage />
|
||||
</RequireGroup>
|
||||
),
|
||||
},
|
||||
{ path: "match/:matchId", element: <MatchDetailPage /> },
|
||||
{ path: "group", element: <GroupPage /> },
|
||||
{
|
||||
path: "group/settings",
|
||||
element: (
|
||||
<RequireGroup>
|
||||
<GroupSettingsPage />
|
||||
</RequireGroup>
|
||||
),
|
||||
},
|
||||
{ path: "account", element: <AccountPage /> },
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/admin",
|
||||
element: (
|
||||
<RequireAdmin>
|
||||
<AdminLayout />
|
||||
</RequireAdmin>
|
||||
),
|
||||
children: [
|
||||
{ index: true, element: <Navigate to="/admin/records" replace /> },
|
||||
{ path: "records", element: <AdminRecordsPage /> },
|
||||
{ path: "accounts", element: <AdminAccountsPage /> },
|
||||
{ path: "factions", element: <AdminFactionsPage /> },
|
||||
{ path: "logs", element: <AdminLogsPage /> },
|
||||
],
|
||||
},
|
||||
{ path: "*", element: <Navigate to="/" replace /> },
|
||||
]);
|
||||
Reference in New Issue
Block a user