mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-26 23:32:43 +00:00
Add spot to input game UID
This commit is contained in:
parent
4231b26eea
commit
219d9f28e1
@ -29,3 +29,39 @@
|
||||
padding-left: 27px;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.SideBar_Enter {
|
||||
display: flex;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-width: 250px;
|
||||
max-height: 50px;
|
||||
margin-bottom: 24px;
|
||||
|
||||
box-sizing: border-box;
|
||||
align-self: center;
|
||||
align-items: center;
|
||||
border-radius: 10px;
|
||||
|
||||
background-color: var(--background-color);
|
||||
}
|
||||
|
||||
.SideBar_Input {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
|
||||
color: var(--text-primary-color);
|
||||
font-size: 20px;
|
||||
width: 100%;
|
||||
padding: 11px;
|
||||
|
||||
&:focus, &:active {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
.SideBar_Input::placeholder {
|
||||
color: var(--text-secondary-color);
|
||||
opacity: 1;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React from "react";
|
||||
import React, { ChangeEvent } from "react";
|
||||
|
||||
import SideBarButton from "@app/ui/widgets/SideBarButton";
|
||||
|
||||
@ -6,9 +6,31 @@ import { navigate } from "@app/backend/events";
|
||||
|
||||
import "@css/views/SideBar.scss";
|
||||
|
||||
class SideBar extends React.Component<any, any> {
|
||||
constructor(props: any) {
|
||||
interface IState {
|
||||
uid: string | null;
|
||||
}
|
||||
|
||||
class SideBar extends React.Component<{}, IState> {
|
||||
constructor(props: {}) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
uid: null
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoked when the UID input changes.
|
||||
*
|
||||
* @param event The event.
|
||||
* @private
|
||||
*/
|
||||
private onChange(event: ChangeEvent<HTMLInputElement>): void {
|
||||
const input = event.target.value;
|
||||
const uid = input == "" ? null : input;
|
||||
if (uid && uid.length > 10) return;
|
||||
|
||||
this.setState({ uid });
|
||||
}
|
||||
|
||||
render() {
|
||||
@ -18,14 +40,31 @@ class SideBar extends React.Component<any, any> {
|
||||
The Ultimate Anime Game Handbook
|
||||
</h1>
|
||||
|
||||
<div className={"SideBar_Buttons"}>
|
||||
<SideBarButton name={"Commands"} anchor={"Commands"} />
|
||||
<SideBarButton name={"Characters"} anchor={"Avatars"} />
|
||||
<SideBarButton name={"Items"} anchor={"Items"} />
|
||||
<SideBarButton name={"Entities"} anchor={"Home"} />
|
||||
<SideBarButton name={"Scenes"} anchor={"Home"} />
|
||||
<SideBarButton name={"Quests"} anchor={"Home"} />
|
||||
<SideBarButton name={"Achievements"} anchor={"Home"} />
|
||||
<div style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
justifyContent: "space-between",
|
||||
height: "100%"
|
||||
}}>
|
||||
<div className={"SideBar_Buttons"}>
|
||||
<SideBarButton name={"Commands"} anchor={"Commands"} />
|
||||
<SideBarButton name={"Characters"} anchor={"Avatars"} />
|
||||
<SideBarButton name={"Items"} anchor={"Items"} />
|
||||
<SideBarButton name={"Entities"} anchor={"Home"} />
|
||||
<SideBarButton name={"Scenes"} anchor={"Home"} />
|
||||
<SideBarButton name={"Quests"} anchor={"Home"} />
|
||||
<SideBarButton name={"Achievements"} anchor={"Home"} />
|
||||
</div>
|
||||
|
||||
<div className={"SideBar_Enter"}>
|
||||
<input
|
||||
type={"text"}
|
||||
className={"SideBar_Input"}
|
||||
placeholder={"Enter UID..."}
|
||||
value={this.state.uid ?? undefined}
|
||||
onChange={this.onChange.bind(this)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user