From 219d9f28e1e84750da3a931f78282662a1216996 Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Sun, 9 Apr 2023 17:46:29 -0400 Subject: [PATCH] Add spot to input game UID --- src/handbook/src/css/views/SideBar.scss | 36 +++++++++++++++ src/handbook/src/ui/views/SideBar.tsx | 61 ++++++++++++++++++++----- 2 files changed, 86 insertions(+), 11 deletions(-) diff --git a/src/handbook/src/css/views/SideBar.scss b/src/handbook/src/css/views/SideBar.scss index de285dd38..52c2ef5ce 100644 --- a/src/handbook/src/css/views/SideBar.scss +++ b/src/handbook/src/css/views/SideBar.scss @@ -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; +} diff --git a/src/handbook/src/ui/views/SideBar.tsx b/src/handbook/src/ui/views/SideBar.tsx index 274d616b2..5d908b8bc 100644 --- a/src/handbook/src/ui/views/SideBar.tsx +++ b/src/handbook/src/ui/views/SideBar.tsx @@ -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 { - 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): 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 { The Ultimate Anime Game Handbook -
- - - - - - - +
+
+ + + + + + + +
+ +
+ +
);