Add css to login

This commit is contained in:
Ceda EI 2019-03-29 13:00:37 +05:30
parent cbf48e751c
commit 005cb2172a
4 changed files with 37 additions and 13 deletions

View File

@ -6,18 +6,20 @@ export default (player) => {
const [input, setInput] = useState(localStorage.getItem("token") ? localStorage.getItem("token"): "" );
return (
<div className="login">
<input type="text" placeholder="Token ID" value={input}
onChange={evt => setInput(evt.target.value)} />
<button
onClick={
() => player.auth(input)
.then(x => {
props.setLoggedIn(x);
if (x === true) {
localStorage.setItem("token", input);
}
})
}>Submit</button>
<div className="wrapper">
<input type="text" placeholder="Token ID" value={input} className="nes-input"
onChange={evt => setInput(evt.target.value)} />
<button className="nes-btn is-primary"
onClick={
() => player.auth(input)
.then(x => {
props.setLoggedIn(x);
if (x === true) {
localStorage.setItem("token", input);
}
})
}>Submit</button>
</div>
</div>
);
}

View File

View File

@ -1,6 +1,7 @@
import React, { useState } from "react";
import ReactDOM from "react-dom";
import "./index.css";
import "./scss/index.scss";
import "nes.css/css/nes.min.css";
import { config } from "./config";
import axios from "axios";
import login from "./components/login";

21
src/scss/index.scss Normal file
View File

@ -0,0 +1,21 @@
.login {
padding: 15%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
box-sizing: border-box;
.wrapper {
width: 100%;
input {
margin-bottom: 1em;
width: 100%;
display: block;
}
button {
width: 100%;
display: block;
}
}
}