refactor: refactor foundation

This commit is contained in:
2026-08-14 09:43:19 +03:00
parent 2e32d226d3
commit da585b157a
54 changed files with 4822 additions and 535 deletions
+2 -13
View File
@@ -4,23 +4,12 @@ import { cleanup, render, screen, waitFor } from "@testing-library/react";
import { MemoryRouter } from "react-router";
import { afterEach, describe, expect, it, vi } from "vitest";
vi.mock("../../shared/api", async (importOriginal) => {
const actual = await importOriginal<typeof import("../../shared/api")>();
return {
...actual,
apiClient: {
...actual.apiClient,
POST: vi.fn(async () => ({ data: undefined })),
},
};
});
import { AuthProvider } from "../../features/auth";
import { AuthProvider } from "@/features/auth";
import {
AccountsPageEmpty,
AccountsPageError,
AccountsPageLoading,
} from "../../pages/accounts";
} from "@/pages/accounts";
import { theme } from "../theme";
import { AppRoutes } from "./AppRoutes";
+8 -8
View File
@@ -1,12 +1,12 @@
import { Navigate, Route, Routes, useLocation } from "react-router";
import { useAuth } from "../../features/auth";
import { AccountPage } from "../../pages/account";
import { AccountsPage } from "../../pages/accounts";
import { LoginPage } from "../../pages/login";
import { NotFoundPage } from "../../pages/not-found";
import { RegisterPage } from "../../pages/register";
import { SettingsPage } from "../../pages/settings";
import { AppShell } from "../../shared/ui/AppShell";
import { useAuth } from "@/features/auth";
import { AccountPage } from "@/pages/account";
import { AccountsPage } from "@/pages/accounts";
import { LoginPage } from "@/pages/login";
import { NotFoundPage } from "@/pages/not-found";
import { RegisterPage } from "@/pages/register";
import { SettingsPage } from "@/pages/settings";
import { AppShell } from "@/shared/ui";
function Protected({ children }: { children: React.ReactNode }) {
const { user, ready } = useAuth();
+3 -3
View File
@@ -1,9 +1,9 @@
import { MantineProvider } from "@mantine/core";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { BrowserRouter } from "react-router";
import { AuthProvider } from "../../features/auth";
import { AppRoutes } from "../routes";
import { theme } from "../theme";
import { AppRoutes } from "@/app/routes";
import { theme } from "@/app/theme";
import { AuthProvider } from "@/features/auth";
const queryClient = new QueryClient({
defaultOptions: { queries: { refetchOnWindowFocus: false } },