Add spot to input game UID

This commit is contained in:
KingRainbow44 2023-04-09 17:46:29 -04:00
parent 4231b26eea
commit 219d9f28e1
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE
2 changed files with 86 additions and 11 deletions

View File

@ -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;
}

View File

@ -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>
);
}