refactor: enforce frontend view model boundaries
Frontend verify / commits (pull_request) Successful in 28s
Frontend verify / security (pull_request) Successful in 10s
Frontend verify / verify (pull_request) Successful in 8m19s

This commit is contained in:
2026-09-28 18:48:23 +03:00
parent 5b69003516
commit ca0ad4f824
287 changed files with 8558 additions and 4538 deletions
-31
View File
@@ -1,31 +0,0 @@
import type { FC } from "react";
import { Button, Stack, Title } from "@mantine/core";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router";
import { useAuth } from "@/features/auth";
import { TbankConnectionSection } from "@/features/tbank-connection";
const SettingsPage: FC = () => {
const { t } = useTranslation();
const { logout } = useAuth();
const navigate = useNavigate();
return (
<Stack>
<Title order={1}>{t("settings.title")}</Title>
<TbankConnectionSection />
<Button
onClick={async () => {
await logout();
await navigate("/login", { replace: true });
}}
>
{t("auth.logout")}
</Button>
</Stack>
);
};
export { SettingsPage };
@@ -0,0 +1,23 @@
import type { FC } from "react";
import { Button, Stack, Title } from "@mantine/core";
import { TbankConnectionSection } from "@/features/tbank-connection";
import { useSettingsPageVm } from "./SettingsPage.vm";
const SettingsPage: FC = () => {
const { onLogout, t } = useSettingsPageVm();
return (
<Stack>
<Title order={1}>{t("settings.title")}</Title>
<TbankConnectionSection />
<Button onClick={onLogout}>{t("auth.logout")}</Button>
</Stack>
);
};
export { SettingsPage };
@@ -0,0 +1,19 @@
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router";
import { useAuth } from "@/features/auth";
function useSettingsPageVm() {
const { t } = useTranslation();
const { logout } = useAuth();
const navigate = useNavigate();
const onLogout = async () => {
await logout();
await navigate("/login", { replace: true });
};
return { onLogout, t };
}
export { useSettingsPageVm };