import React, { Fragment, PureComponent } from 'react'; import PropTypes from 'prop-types'; import { withStyles } from '@material-ui/core/styles'; import classNames from 'classnames'; import SwipeableViews from 'react-swipeable-views'; import AddIcon from '@material-ui/icons/Add'; import EditIcon from '@material-ui/icons/Create'; import NavigationIcon from '@material-ui/icons/Navigation'; import UpIcon from '@material-ui/icons/KeyboardArrowUp'; import DeleteIcon from '@material-ui/icons/Delete'; import { green } from '@material-ui/core/colors'; import { Typography, Grid, Fab, AppBar, Tabs, Tab, Zoom, Icon } from '@material-ui/core'; const styles = theme => ({ demo: { height: 'auto', }, divider: { display: 'block', margin: `${theme.spacing(3)}px 0`, }, button: { margin: theme.spacing(1), }, root: { backgroundColor: theme.palette.background.paper, [theme.breakpoints.up('sm')]: { width: 500, }, margin: '0 auto', position: 'relative', minHeight: 200, }, fab: { position: 'absolute', bottom: theme.spacing(2), right: theme.spacing(2), }, fabGreen: { color: theme.palette.common.white, backgroundColor: green[500], }, extendedIcon: { marginRight: theme.spacing(1), }, }); function TabContainer(props) { const { children, dir } = props; return ( {children} ); } TabContainer.propTypes = { children: PropTypes.node.isRequired, dir: PropTypes.string.isRequired, }; class FloatingButtons extends PureComponent { state = { value: 0, }; handleChange = (event, value) => { this.setState({ value }); }; handleChangeIndex = index => { this.setState({ value: index }); }; render() { const { classes, theme } = this.props; const transitionDuration = { enter: theme.transitions.duration.enteringScreen, exit: theme.transitions.duration.leavingScreen, }; const fabs = [ { color: 'primary', className: classes.fab, icon: , }, { color: 'secondary', className: classes.fab, icon: , }, { color: 'inherit', className: classNames(classes.fab, classes.fabGreen), icon: , }, ]; return ( Floating Action Buttons A floating action button represents the primary action in an application. edit_icon Extended Floating BUtton in Tab A floating action button that spans multiple lateral screens (such as tabbed screens) should briefly disappear, then reappear if its action changes.
Item One Item Two Item Three {fabs.map((fab, index) => ( {fab.icon} ))}
); } } FloatingButtons.propTypes = { classes: PropTypes.object.isRequired, theme: PropTypes.object.isRequired, }; export default withStyles(styles, { withTheme: true })(FloatingButtons);