revised login form (#143)

This commit is contained in:
Michael Quigley 2023-01-03 16:16:34 -05:00
parent ea50a833aa
commit 63f2049c2c
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 62 additions and 136 deletions

View File

@ -1,5 +1,6 @@
import {useState} from "react"; import {useState} from "react";
import * as account from '../../api/account'; import * as account from '../../api/account';
import {Button, Container, Form, Row} from "react-bootstrap";
const Login = (props) => { const Login = (props) => {
const [email, setEmail] = useState(''); const [email, setEmail] = useState('');
@ -10,6 +11,7 @@ const Login = (props) => {
const handleSubmit = async e => { const handleSubmit = async e => {
e.preventDefault() e.preventDefault()
console.log(email, password);
account.login({body: {"email": email, "password": password}}) account.login({body: {"email": email, "password": password}})
.then(resp => { .then(resp => {
@ -34,16 +36,45 @@ const Login = (props) => {
return ( return (
<div className={"fullscreen"}> <div className={"fullscreen"}>
<img src={"/ziggy.svg"} width={200}/> <Container fluid>
<h1>zrok</h1> <Row>
{message} <img alt="ziggy" src={"/ziggy.svg"} width={200}/>
<form onSubmit={handleSubmit}> </Row>
<fieldset> <Row>
<legend>Log In</legend> <h1>zrok</h1>
<p><label htmlFor="email">email: </label><input type="text" value={email} placeholder="enter an email" onChange={({target}) => setEmail(target.value)}/></p> </Row>
<p><label htmlFor="password">password: </label><input type="password" value={password} placeholder="enter a password" onChange={({target}) => setPassword(target.value)}/><button type="submit">Log In</button></p> <Row className={"fullscreen-body"}>
</fieldset> <Container className={"fullscreen-form"}>
</form> <Row>
{message}
</Row>
<Row>
<Form onSubmit={handleSubmit}>
<Form.Group controlId={"email"} >
<Form.Control
type={"email"}
placeholder={"Email Address"}
onChange={t => { setMessage(null); setEmail(t.target.value); }}
value={email}
/>
</Form.Group>
<Form.Group controlId={"password"}>
<Form.Control
type={"password"}
placeholder={"Password"}
onChange={t => { setMessage(null); setPassword(t.target.value); }}
value={password}
/>
</Form.Group>
<Button variant={"light"} type={"submit"}>Log In</Button>
</Form>
</Row>
</Container>
</Row>
</Container>
</div> </div>
) )
} }

View File

@ -62,142 +62,37 @@ code, pre {
margin-bottom: 25px; margin-bottom: 25px;
} }
/*
#zrok-enable {
text-align: center;
margin-top: 100px;
}
#zrok-enable h1 {
margin-bottom: 50px;
}
.container {
display: grid;
margin-left: 10%;
margin-right: 10%;
}
.fullscreen { .fullscreen {
background-color: #3b2693; background-color: #3b2693;
text-align: center; padding: 25px;
padding: 25px; color: white;
color: white; display: flex;
display: flex; align-items: center;
flex-direction: column; height: 100vh;
align-items: center;
height: 100vh;
justify-content: center;
} }
.fullscreen .row {
text-align: center;
justify-content: center;
}
.fullscreen h1 { .fullscreen h1 {
font-size: 64pt; font-size: 96pt;
}
.fullscreen fieldset {
width: 500px;
border-radius: 25px;
}
.fullscreen label {
text-align: right;
width: 100px;
float: left;
font-family: 'Russo One', sans-serif;
margin-right: 10px;
}
.fullscreen fieldset legend {
font-family: 'Russo One', sans-serif;
}
.fullscreen fieldset p {
clear: both;
padding: 5px;
}
.fullscreen input {
width: 300px;
float: left;
}
.fullscreen p a {
color: white;
font-weight: bold;
} }
.header { .fullscreen-body {
background-color: #3b2693; margin-top: 6em;
color: white;
padding-left: 2em;
padding-right: 2em;
display: flex;
align-items: center;
border-radius: 0 0 25px 25px;
}
.header-title {
font-family: 'Russo One', sans-serif;
font-size: 3em;
margin-left: 0.53em;
border: 1px solid red;
}
.header-status {
width: 100%;
display: grid;
grid-template-rows: 1fr 1fr;
}
.header-status div p {
font-size: 75%;
}
.header-status div {
text-align: right;
}
.header-controls {
display: flex;
justify-content: right;
align-items: flex-end;
}
.header-controls button {
margin-left: 30px;
display: flex;
align-items: center;
background-color: #30205d;
border-radius: 5px 5px 5px 5px;
border: 1px solid #7733ff;
color: #7733ff;
padding: 5px;
width: 100px;
justify-content: center;
height: 2em;
margin-bottom: 1em;
}
.header-controls button:hover {
color: white;
border-color: white;
} }
.main { .fullscreen form {
padding: 2em; margin: 15px;
} }
.rdt_TableCol_Sortable div { .fullscreen form input {
font-family: 'Russo One', sans-serif; margin: 15px 0;
font-size: 1.25em; width: 400px;
}
.network {
height: 400px;
}
.react-flow__attribution {
display: none;
}
.nested-services {
padding-left: 10em;
}
.popover {
padding: 0 25px;
}
svg.flowNode {
vertical-align: middle;
} }
.errorMessage { .errorMessage {
color: deeppink; color: deeppink;
} }
*/