Added user name to the header.

feature/appm-store/pbac
Menaka Jayawardena 7 years ago
parent 6b944a4e9f
commit 75427e1021

@ -19,7 +19,6 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React, {Component} from 'react'; import React, {Component} from 'react';
import {withRouter} from 'react-router-dom'; import {withRouter} from 'react-router-dom';
import Axios from 'axios';
import AuthHandler from "../../api/authHandler"; import AuthHandler from "../../api/authHandler";
import {Button, Col, Container, Input, Row,} from 'reactstrap'; import {Button, Col, Container, Input, Row,} from 'reactstrap';
import ApplicationCreate from '../Application/Create/ApplicationCreate'; import ApplicationCreate from '../Application/Create/ApplicationCreate';
@ -50,7 +49,7 @@ class BaseLayout extends Component {
} }
componentWillMount() { componentWillMount() {
this.setState({user: this.props.user});
} }
handleApplicationClick() { handleApplicationClick() {
@ -86,22 +85,34 @@ class BaseLayout extends Component {
} }
render() { render() {
const userName = this.state.user._userName[0];
return ( return (
<div> <div>
<div id="header-content"> <div className="header-content">
<div className="header">
<div id="header"> <Row>
<Col md="6">
<span id="header-text"> <span id="header-text">
<Logo className="header-image" image_name="logo.png"/> <Logo className="header-image" image_name="logo.png"/>
IoT <FormattedMessage id="App.Publisher" defaultMessage="Application Publisher"/> IoT <FormattedMessage id="App.Publisher" defaultMessage="Application Publisher"/>
</span> </span>
<div id="header-btn-container"> </Col>
<Button id="header-button"><i className="fw fw-notification btn-header"></i></Button> <Col>
<Button id="header-button"><i className="fw fw-user btn-header"></i></Button> <div className="header-button-container">
<Button id="header-button">
<i className="fw fw-notification btn-header"></i></Button>
<span className="header-user-name">
{userName.charAt(0).toUpperCase() + userName.slice(1)}
</span>
<Button id="header-button">
<i className="fw fw-user btn-header"></i></Button>
</div> </div>
<div id="search-box"> </Col>
<i className="fw fw-search search-icon"> </Row>
</i> <Row>
<Col>
<div className="search-box">
<i className="fw fw-search"></i>
<Input <Input
id="search" id="search"
name="search" name="search"
@ -109,6 +120,8 @@ class BaseLayout extends Component {
onChange={(event) => console.log(event.target.value)} //TODO: Remove this onChange={(event) => console.log(event.target.value)} //TODO: Remove this
/> />
</div> </div>
</Col>
</Row>
</div> </div>
<Container> <Container>
<div id="add-btn-container"> <div id="add-btn-container">

Loading…
Cancel
Save