diff --git a/frontend/src/ui/components/Auth.tsx b/frontend/src/ui/components/Auth.tsx
index 2a52519..65da3a3 100644
--- a/frontend/src/ui/components/Auth.tsx
+++ b/frontend/src/ui/components/Auth.tsx
@@ -8,4 +8,32 @@ export function AuthContainer({ children }: { children?: React.ReactNode }) {
)
+}
+
+export type IconType = "filled" | "outlined";
+
+export interface AuthHeaderIcon {
+ name: string;
+ type: IconType
+}
+
+export interface AuthHeaderProps {
+ title: string;
+ icon: string | AuthHeaderIcon;
+ subtitle: string;
+}
+
+export function AuthHeader({ title, icon, subtitle }: AuthHeaderProps) {
+ const iconType = typeof icon == "string" ? "filled" : icon.type;
+ const iconName = typeof icon == "string" ? icon : icon.name;
+
+ return (
+
+
+ {iconName}
+ {title}
+
+
{subtitle}
+
+ )
}
\ No newline at end of file
diff --git a/frontend/src/ui/screen/LoginScreen.tsx b/frontend/src/ui/screen/LoginScreen.tsx
index 3d5c11f..cf95ec2 100644
--- a/frontend/src/ui/screen/LoginScreen.tsx
+++ b/frontend/src/ui/screen/LoginScreen.tsx
@@ -1,13 +1,14 @@
import { useImmer } from "use-immer";
import { showChat, showRegister } from "../../navigation";
import { AlertsContainer, type Alert, type AlertType } from "../components/Alerts";
-import { AuthContainer } from "../components/Auth";
+import { AuthContainer, AuthHeader } from "../components/Auth";
import type { ErrorResponse, LoginRequest, LoginResponse } from "../../core/types";
import { setUser } from "../../auth/api";
import { ensureKeysOnLogin } from "../../auth/crypto";
import { API_BASE_URL } from "../../core/config";
import { initializeProfile } from "../../userPanel/profile/profile";
import { useRef } from "react";
+import type { TextField } from "mdui/components/text-field";
export default function LoginScreen() {
const [alerts, updateAlerts] = useImmer([]);
@@ -16,18 +17,12 @@ export default function LoginScreen() {
updateAlerts((alerts) => alerts.push({type: type, message: message}));
}
- const usernameElement = useRef(null);
- const passwordElement = useRef(null);
+ const usernameElement = useRef(null);
+ const passwordElement = useRef(null);
return (
-
-
- login
- Добро пожаловать!
-
-
Войдите в свой аккаунт
-
+
@@ -84,7 +79,7 @@ export default function LoginScreen() {
icon="person--filled"
autocomplete="username"
required
- ref={usernameElement}>
+ ref={usernameElement as React.RefObject
}>
+ ref={passwordElement as React.RefObject}>
Войти
diff --git a/frontend/src/ui/screen/RegisterScreen.tsx b/frontend/src/ui/screen/RegisterScreen.tsx
index 8940ecf..ecc8f77 100644
--- a/frontend/src/ui/screen/RegisterScreen.tsx
+++ b/frontend/src/ui/screen/RegisterScreen.tsx
@@ -1,20 +1,85 @@
+import { useImmer } from "use-immer";
import { showLogin } from "../../navigation";
-import { AuthContainer } from "../components/Auth";
+import { AuthContainer, AuthHeader } from "../components/Auth";
+import { AlertsContainer, type Alert, type AlertType } from "../components/Alerts";
+import { useRef } from "react";
+import { TextField } from "mdui/components/text-field";
+import type { ErrorResponse, RegisterRequest } from "../../core/types";
+import { API_BASE_URL } from "../../core/config";
+import { delay } from "../../utils/utils";
export default function RegisterScreen() {
+ const [alerts, updateAlerts] = useImmer([]);
+
+ function showAlert(type: AlertType, message: string) {
+ updateAlerts((alerts) => alerts.push({type: type, message: message}));
+ }
+
+ const usernameElement = useRef(null);
+ const passwordElement = useRef(null);
+ const confirmPasswordElement = useRef(null);
+
return (
-
-
- person_add
- Регистрация
-
-
Создайте новый аккаунт
-
+