mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-30 08:32:06 +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,6 +40,12 @@ class SideBar extends React.Component<any, any> {
|
||||
The Ultimate Anime Game Handbook
|
||||
</h1>
|
||||
|
||||
<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"} />
|
||||
@ -27,6 +55,17 @@ class SideBar extends React.Component<any, any> {
|
||||
<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