Skip to content

Commit

Permalink
version 11: minor css changes and draft app dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Kumar authored and Kumar committed Apr 21, 2020
1 parent 853fa5a commit 94a84e7
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 4 deletions.
54 changes: 54 additions & 0 deletions src/component/AppDashboard.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React, { Component } from 'react';
import Modal from 'react-bootstrap/Modal';
import Button from 'react-bootstrap/Button';

class AppDashboard extends Component {
constructor(props) {
super(props);
}
render() {
const { show } = this.props;
return (
<div>
{/* <Alert show={show} variant="success">
<Alert.Heading>Application Status</Alert.Heading>
<p>
Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget
lacinia odio sem nec elit. Cras mattis consectetur purus sit amet
fermentum.
</p>
<hr />
<div className="d-flex justify-content-end">
<Button onClick={() => this.props.closeAppStatus()} variant="outline-success">
Close me!
</Button>
</div>
</Alert> */}

<Modal show={show} onHide={() => this.props.closeAppStatus()} animation={false}>
<Modal.Header closeButton>
<Modal.Title>Application Status</Modal.Title>
</Modal.Header>
<Modal.Body>
<label>Stocks Latest Nav Date: </label>
<span>
100.5
</span>
<label>Mutual Fund Latest Nav Date: </label>
<span>
100.5
</span>
</Modal.Body>
<Modal.Footer>
<Button variant="secondary" onClick={() => this.props.closeAppStatus()}>
Close
</Button>
</Modal.Footer>
</Modal>
</div>
);
}

}

export default AppDashboard;
26 changes: 23 additions & 3 deletions src/component/MyHeader.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import React, { Component } from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import * as utils from './Utils'
import Button from 'react-bootstrap/Button'
import AppDashboard from './AppDashboard';

class MyHeader extends Component {

constructor(props) {
super(props);
this.state = {
totalNetworth: null,
totalNetworthChange: null
totalNetworthChange: null,
show: false
}
this.closeAppStatus = this.closeAppStatus.bind(this);
}

static getDerivedStateFromProps(props, state) {
Expand All @@ -23,9 +27,21 @@ class MyHeader extends Component {
return { totalNetworth: totalNetworth, totalNetworthChange: totalNetworthChange };
}

closeAppStatus() {
this.setState({
show: false
});
}

showAppStatus() {
this.setState({
show: true
});
}


render() {
const { totalNetworth, totalNetworthChange } = this.state;
const { totalNetworth, totalNetworthChange, show } = this.state;
let icon;
if (totalNetworthChange < 0) {
icon = <FontAwesomeIcon icon="arrow-alt-circle-down" color="red" className="ml-1" />
Expand Down Expand Up @@ -55,6 +71,10 @@ class MyHeader extends Component {
{icon}
</span>
</div>
<div className="col">
<Button onClick={() => this.showAppStatus()} variant="outline-success">App Status!</Button>
<AppDashboard show={show} closeAppStatus={this.closeAppStatus.bind(this)}/>
</div>
</div>

</nav>
Expand Down
2 changes: 1 addition & 1 deletion src/component/MySidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class MySidebar extends Component {
const { links } = this.state;
return (
<nav className="col-md-2 bg-light sidebar">
<div className="sidebar-sticky">
<div>
<ul className="nav flex-column">
{links.map((link, i) =>
<NavLink
Expand Down

0 comments on commit 94a84e7

Please sign in to comment.