done minor fixes responive navbar

This commit is contained in:
Nicola Brunner 2020-03-19 11:49:00 +01:00
parent 3360220669
commit c6e483ea6c

View file

@ -8,6 +8,7 @@ class Navbar extends Component {
super(props); super(props);
this.state = { this.state = {
activeItem: 'Home', activeItem: 'Home',
activeItemName: 'Home',
edited: "", edited: "",
editMode : false editMode : false
} }
@ -15,9 +16,10 @@ class Navbar extends Component {
editModeController = (e) => this.setState((prevState) => ({ editMode: !prevState.editMode })); editModeController = (e) => this.setState((prevState) => ({ editMode: !prevState.editMode }));
handleClick = (e, {id}) => { handleClick = (e, {id, name}) => {
console.log(id); console.log(id);
this.setState({ activeItem: id, this.setState({ activeItem: id,
activeItemName: name
}); });
this.props.handleItemClick(id) this.props.handleItemClick(id)
} }
@ -104,7 +106,7 @@ class Navbar extends Component {
<Responsive as={Segment} maxWidth={768}> <Responsive as={Segment} maxWidth={768}>
<Menu inverted> <Menu inverted>
<Dropdown item fluid text='Select Room'> <Dropdown item fluid text={this.state.activeItemName}>
<Dropdown.Menu> <Dropdown.Menu>
<Dropdown.Item <Dropdown.Item