one way of approaching nav

This commit is contained in:
Jake McDermott
2018-10-11 11:31:37 -04:00
parent b2ebbc6a0a
commit b31edef9b2
32 changed files with 4286 additions and 2335 deletions

View File

@@ -1,9 +0,0 @@
import React from 'react';
const Dashboard = () => (
<div>
<h2>Dashboard</h2>
</div>
);
export default Dashboard;

View File

@@ -1,69 +0,0 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router-dom';
import {
Bullseye,
Button,
TextInput
} from '@patternfly/react-core';
import api from '../api';
class Login extends Component {
state = {
username: '',
password: '',
redirect: false,
};
handleUsernameChange = value => this.setState({ username: value });
handlePasswordChange = value => this.setState({ password: value });
handleSubmit = event => {
const { username, password } = this.state;
event.preventDefault();
api.login(username, password)
.then(() => this.setState({ redirect: true }));
}
render () {
const { username, password, redirect } = this.state;
if (redirect) {
return (<Redirect to="/" />);
}
return (
<Bullseye>
<form onSubmit={this.handleSubmit}>
<div>
<TextInput
aria-label="Username"
name="username"
type="text"
onChange={this.handleUsernameChange}
value={username}
/>
</div>
<div>
<TextInput
aria-label="Password"
name="password"
type="password"
onChange={this.handlePasswordChange}
value={password}
/>
</div>
<Button type="submit">
Login
</Button>
</form>
</Bullseye>
);
}
}
export default Login;

View File

@@ -0,0 +1,31 @@
import React, { Component } from 'react';
import {
Card,
CardHeader,
CardBody,
} from '@patternfly/react-core';
class OrganizationCard extends Component {
static title = 'Organization Card';
constructor (props) {
super(props);
const { name } = props.organization;
this.state = { name };
}
render () {
const { name } = this.state;
return (
<Card>
<CardHeader>{name}</CardHeader>
<CardBody>Card Body</CardBody>
</Card>
);
}
}
export default OrganizationCard;

View File

@@ -1,9 +0,0 @@
import React from 'react';
const Organizations = () => (
<div>
<h2>Organizations</h2>
</div>
);
export default Organizations;

View File

@@ -0,0 +1,50 @@
import React, { Component } from 'react';
import { withRouter } from 'react-router-dom';
import { Brand } from '@patternfly/react-core';
import TowerLogoHeader from './tower-logo-header.svg';
import TowerLogoHeaderHover from './tower-logo-header-hover.svg';
class TowerLogo extends Component {
constructor (props) {
super(props);
this.state = { hover: false };
}
onClick = () => {
const { history } = this.props;
history.push('/');
};
onHover = () => {
const { hover } = this.state;
this.setState({ hover: !hover });
};
render () {
const { hover } = this.state;
let src = TowerLogoHeader;
if (hover) {
src = TowerLogoHeaderHover;
}
return (
<Brand
src={src}
alt="Tower Brand Image"
onMouseOut={this.onHover}
onMouseOver={this.onHover}
onBlur={this.onHover}
onFocus={this.onHover}
onClick={this.onClick}
/>
);
}
}
export default withRouter(TowerLogo);

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 35" style="enable-background:new 0 0 100 35;" xml:space="preserve">
<style type="text/css">
.st0{fill:#5FBDBE;}
.st1{fill:#1D1D1D;}
</style>
<g id="Layer_1_1_">
<g>
<path class="st0" d="M43.6,11.8v11.6h-1.5V11.8h-3.8v-1.4h9v1.3L43.6,11.8L43.6,11.8z"/>
<path class="st0" d="M54.4,23.7c-3.3,0-5.3-2.7-5.3-6.7s2.2-6.7,5.4-6.7c3.3,0,5.4,2.7,5.4,6.7S57.6,23.7,54.4,23.7z M54.4,11.6
c-2.2,0-3.9,2.1-3.9,5.3s1.6,5.4,4,5.4c2.3,0,3.9-2.1,3.9-5.3S56.6,11.6,54.4,11.6L54.4,11.6z"/>
<path class="st0" d="M72.8,23.5h-1.6l-2-8.2c-0.2-0.9-0.5-2.2-0.6-2.9c-0.1,0.9-0.4,2-0.6,2.9l-2,8.2h-1.6l-2.7-13h1.5l1.5,8.2
c0.1,0.9,0.4,2.3,0.5,2.9c0.1-0.6,0.4-2,0.6-2.8l2.1-8.4h1.5l2.1,8.4c0.2,0.9,0.5,2.2,0.6,2.8c0.1-0.6,0.3-2,0.5-2.9l1.5-8.2h1.4
L72.8,23.5z"/>
<path class="st0" d="M78,23.5V10.4h7.8v1.3h-6.4v4.1h3.7v1.4h-3.7V22h6.7v1.3C86.3,23.5,78,23.5,78,23.5z"/>
<path class="st0" d="M95,17.8l2.8,5.6h-1.6l-2.8-5.5h-3v5.5h-1.5v-13H94c2.3,0,4,1.2,4,3.7c0.2,1.7-1,3.4-2.7,3.7
C95.2,17.8,95.2,17.8,95,17.8z M94,11.8h-3.6v4.8h3.5c1.8,0,2.8-0.9,2.8-2.4S95.8,11.8,94,11.8L94,11.8z"/>
</g>
<circle class="st0" cx="16.8" cy="17.3" r="15.7"/>
<path class="st1" d="M24.2,23.6L18,8.5C17.8,8,17.1,7.7,16.6,8c-0.2,0.1-0.4,0.3-0.5,0.5L9.2,25h2.4l2.7-6.8l8,6.6
c0.2,0.2,0.5,0.3,0.9,0.4c0.5,0.1,1.1-0.3,1.2-1v-0.1V24C24.3,23.9,24.3,23.7,24.2,23.6z M17,11.2l4.1,10.1l-6.2-4.8L17,11.2z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 35" style="enable-background:new 0 0 100 35;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
.st1{fill:#1D1D1D;}
</style>
<g id="Layer_1_1_">
<g>
<path class="st0" d="M43.6,11.8v11.6h-1.5V11.8h-3.8v-1.4h9v1.3L43.6,11.8L43.6,11.8z"/>
<path class="st0" d="M54.4,23.7c-3.3,0-5.3-2.7-5.3-6.7s2.2-6.7,5.4-6.7c3.3,0,5.4,2.7,5.4,6.7S57.6,23.7,54.4,23.7z M54.4,11.6
c-2.2,0-3.9,2.1-3.9,5.3s1.6,5.4,4,5.4c2.3,0,3.9-2.1,3.9-5.3S56.6,11.6,54.4,11.6L54.4,11.6z"/>
<path class="st0" d="M72.8,23.5h-1.6l-2-8.2c-0.2-0.9-0.5-2.2-0.6-2.9c-0.1,0.9-0.4,2-0.6,2.9l-2,8.2h-1.6l-2.7-13h1.5l1.5,8.2
c0.1,0.9,0.4,2.3,0.5,2.9c0.1-0.6,0.4-2,0.6-2.8l2.1-8.4h1.5l2.1,8.4c0.2,0.9,0.5,2.2,0.6,2.8c0.1-0.6,0.3-2,0.5-2.9l1.5-8.2h1.4
L72.8,23.5z"/>
<path class="st0" d="M78,23.5V10.4h7.8v1.3h-6.4v4.1h3.7v1.4h-3.7V22h6.7v1.3C86.3,23.5,78,23.5,78,23.5z"/>
<path class="st0" d="M95,17.8l2.8,5.6h-1.6l-2.8-5.5h-3v5.5h-1.5v-13H94c2.3,0,4,1.2,4,3.7c0.2,1.7-1,3.4-2.7,3.7
C95.2,17.8,95.2,17.8,95,17.8z M94,11.8h-3.6v4.8h3.5c1.8,0,2.8-0.9,2.8-2.4S95.8,11.8,94,11.8L94,11.8z"/>
</g>
<circle class="st0" cx="16.8" cy="17.3" r="15.7"/>
<path class="st1" d="M24.2,23.6L18,8.5C17.8,8,17.1,7.7,16.6,8c-0.2,0.1-0.4,0.3-0.5,0.5L9.2,25h2.4l2.7-6.8l8,6.6
c0.2,0.2,0.5,0.3,0.9,0.4c0.5,0.1,1.1-0.3,1.2-1v-0.1V24C24.3,23.9,24.3,23.7,24.2,23.6z M17,11.2l4.1,10.1l-6.2-4.8L17,11.2z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB