Created
July 11, 2018 13:52
-
-
Save NickToye/ed63428c7549254392cafc0078e17adf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import PropTypes from "prop-types"; | |
import { withStyles } from "@material-ui/core/styles"; | |
import BottomNavigation from "@material-ui/core/BottomNavigation"; | |
import BottomNavigationAction from "@material-ui/core/BottomNavigationAction"; | |
import RestoreIcon from "@material-ui/icons/Restore"; | |
import FavoriteIcon from "@material-ui/icons/Favorite"; | |
import LocationOnIcon from "@material-ui/icons/LocationOn"; | |
const styles = { | |
root: { | |
width: 500 | |
} | |
}; | |
class SimpleBottomNavigation extends React.Component { | |
state = { | |
value: 0 | |
}; | |
handleChange = (event, value) => { | |
this.setState({ value }); | |
}; | |
render() { | |
const { classes } = this.props; | |
const { value } = this.state; | |
return ( | |
<BottomNavigation | |
value={value} | |
onChange={this.handleChange} | |
showLabels | |
className={classes.root} | |
> | |
<BottomNavigationAction label="Recents" icon={<RestoreIcon />} /> | |
<BottomNavigationAction label="Favorites" icon={<FavoriteIcon />} /> | |
<BottomNavigationAction label="Nearby" icon={<LocationOnIcon />} /> | |
</BottomNavigation> | |
); | |
} | |
} | |
SimpleBottomNavigation.propTypes = { | |
classes: PropTypes.object.isRequired | |
}; | |
export default withStyles(styles)(SimpleBottomNavigation); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment