Commit d0b02466 authored by Chunchi Che's avatar Chunchi Che

add friendPrivateID

parent 165026cc
......@@ -13,6 +13,7 @@ import styles from "./index.module.scss";
interface CustomRoomProps {
options: Options;
isPrivate: boolean;
friendPrivateID?: number;
}
const defaultProps: CustomRoomProps = {
......@@ -25,7 +26,7 @@ export const mcCustomRoomStore = proxy<CustomRoomProps>(defaultProps);
export const CustomRoomContent: React.FC = () => {
const { message } = App.useApp();
const user = useSnapshot(accountStore).user;
const { options } = useSnapshot(mcCustomRoomStore);
const { options, friendPrivateID } = useSnapshot(mcCustomRoomStore);
const privateRoomID = getPrivateRoomID(user?.external_id ?? 0);
useEffect(() => {
......@@ -75,6 +76,9 @@ export const CustomRoomContent: React.FC = () => {
const onChangeAutoDeath: CheckboxProps["onChange"] = (e) => {
mcCustomRoomStore.options.auto_death = e.target.checked;
};
const onChangePrivateID = (event: ChangeEvent<HTMLInputElement>) => {
mcCustomRoomStore.friendPrivateID = Number(event.target.value);
};
return (
<div className={styles.container}>
......@@ -181,6 +185,12 @@ export const CustomRoomContent: React.FC = () => {
>
40分自动加时
</Checkbox>
<Input
value={friendPrivateID}
onChange={onChangePrivateID}
placeholder="在这输入你朋友的私密房间密码"
type="number"
/>
</div>
);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment