use a few more pf-core components

This commit is contained in:
Jake McDermott 2018-09-26 21:39:04 -04:00
parent d926378cf5
commit b2ebbc6a0a
No known key found for this signature in database
GPG Key ID: 9A6F084352C3A0B7
2 changed files with 26 additions and 24 deletions

2
dist/index.html vendored
View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>AWX</title>
<title>AWX</title>
</head>
<body>
<div id="app"></div>

View File

@ -1,7 +1,11 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router-dom';
import { Button } from '@patternfly/react-core';
import {
Bullseye,
Button,
TextInput
} from '@patternfly/react-core';
import api from '../api';
@ -12,7 +16,9 @@ class Login extends Component {
redirect: false,
};
handleChange = event => this.setState({ [event.target.name]: event.target.value });
handleUsernameChange = value => this.setState({ username: value });
handlePasswordChange = value => this.setState({ password: value });
handleSubmit = event => {
const { username, password } = this.state;
@ -31,35 +37,31 @@ class Login extends Component {
}
return (
<form onSubmit={this.handleSubmit}>
<div className="field">
<label htmlFor="username">
Username
<input
id="username"
<Bullseye>
<form onSubmit={this.handleSubmit}>
<div>
<TextInput
aria-label="Username"
name="username"
type="text"
onChange={this.handleChange}
onChange={this.handleUsernameChange}
value={username}
/>
</label>
</div>
<div>
<label htmlFor="password">
Password
<input
id="password"
</div>
<div>
<TextInput
aria-label="Password"
name="password"
type="password"
onChange={this.handleChange}
onChange={this.handlePasswordChange}
value={password}
/>
</label>
</div>
<Button type="submit">
Login
</Button>
</form>
</div>
<Button type="submit">
Login
</Button>
</form>
</Bullseye>
);
}
}