From 3a7e4970d4628fb208dfe89fd45314e1236bc197 Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Mon, 8 Sep 2025 03:09:05 +0800 Subject: [PATCH] ui: login & register --- client/ui/App.tsx | 51 +++++++++++----------- client/ui/dialog/LoginDialog.tsx | 49 +++++++++++++++------ client/ui/dialog/RegisterDialog.tsx | 67 +++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+), 40 deletions(-) create mode 100644 client/ui/dialog/RegisterDialog.tsx diff --git a/client/ui/App.tsx b/client/ui/App.tsx index a95c445..5aaed24 100644 --- a/client/ui/App.tsx +++ b/client/ui/App.tsx @@ -9,11 +9,11 @@ import User from "../api/client_data/User.ts" import RecentChat from "../api/client_data/RecentChat.ts" import * as React from 'react' -import * as CryptoES from 'crypto-es' import { Button, Dialog, NavigationRail, TextField } from "mdui" import Split from 'split.js' import 'mdui/jsx.zh-cn.d.ts' import { checkApiSuccessOrSncakbar } from "./snackbar.ts"; +import RegisterDialog from "./dialog/RegisterDialog.tsx"; declare global { namespace React { @@ -27,7 +27,7 @@ declare global { export default function App() { const [recentsList, setRecentsList] = React.useState([ - { + { id: '0', avatar: "https://www.court-records.net/mugshot/aa6-004-maya.png", title: "麻油衣酱", @@ -38,11 +38,11 @@ export default function App() { avatar: "https://www.court-records.net/mugshot/aa6-004-maya.png", title: "Maya Fey", content: "我是绫里真宵, 是一名灵媒师~" - }, + }, ] as RecentChat[]) const [contactsMap, setContactsMap] = React.useState({ 所有: [ - { + { id: '0', avatar: "https://www.court-records.net/mugshot/aa6-004-maya.png", nickname: "麻油衣酱", @@ -51,7 +51,7 @@ export default function App() { id: '0', avatar: "https://www.court-records.net/mugshot/aa6-004-maya.png", nickname: "Maya Fey", - }, + }, ], } as unknown as { [key: string]: User[] }) const [navigationItemSelected, setNavigationItemSelected] = React.useState('Recents') @@ -62,25 +62,16 @@ export default function App() { }) const loginDialogRef: React.MutableRefObject = React.useRef(null) - const inputAccountRef: React.MutableRefObject = React.useRef(null) - const inputPasswordRef: React.MutableRefObject = React.useRef(null) - const registerButtonRef: React.MutableRefObject