This commit is contained in:
2023-07-04 12:09:53 +08:00
parent 14723e2cd1
commit c99766f316
8 changed files with 74 additions and 22 deletions

View File

@@ -1,8 +1,10 @@
import { Component, ComponentChildren, ContextType } from "preact";
import { BCtx } from "./BContext.tsx";
import { Ref, useRef, useState } from "preact/hooks";
import type _TextField from "../server/md3/md-outlined-text-field.ts";
import type { MdOutlinedTextField as _TextFieldE } from "../server/md3/md-outlined-text-field.ts";
import type {
_MdOutlinedTextField as _TextFieldE,
MdOutlinedTextField as _TextField,
} from "../server/md3.ts";
import { MdOutlinedTextField } from "../server/dmodule.ts";
import List from "preact-material-components/List";

View File

@@ -3,6 +3,7 @@ import { GlobalCtx } from "./GlobalContext.tsx";
import BMd3TextField from "./BMd3TextField.tsx";
import t from "../server/i18n.ts";
import { useState } from "preact/hooks";
import { MdTonalButton } from "../server/dmodule.ts";
type Props = {
show: boolean;
@@ -13,8 +14,10 @@ export default class CreateRootUser extends Component<Props> {
declare context: ContextType<typeof GlobalCtx>;
render() {
if (!this.props.show) return null;
if (!MdTonalButton.value) return null;
const [username, set_username] = useState<string>();
console.log(username);
const [password, set_password] = useState<string>();
const Button = MdTonalButton.value;
return (
<div>
<BMd3TextField
@@ -23,6 +26,20 @@ export default class CreateRootUser extends Component<Props> {
value={username}
set_value={set_username}
/>
<BMd3TextField
label={t("user.password")}
type="password"
value={password}
set_value={set_password}
/>
<Button
disabled={false}
onClick={() => {
console.log("Click");
}}
>
Login
</Button>
</div>
);
}