Skip to content

Commit

Permalink
use a few more pf-core components
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemcdermott committed Sep 27, 2018
1 parent d926378 commit b2ebbc6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>AWX</title>
<title>AWX</title>
</head>
<body>
<div id="app"></div>
Expand Down
48 changes: 25 additions & 23 deletions src/components/Login.jsx
Original file line number Diff line number Diff line change
@@ -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';

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

0 comments on commit b2ebbc6

Please sign in to comment.