import React from 'react'; import clsx from 'clsx'; import SwipeableViews from 'react-swipeable-views'; import { makeStyles, useTheme, Theme, createStyles } from '@material-ui/core/styles'; import AppBar from '@material-ui/core/AppBar'; import Tabs from '@material-ui/core/Tabs'; import Tab from '@material-ui/core/Tab'; import Typography from '@material-ui/core/Typography'; import Zoom from '@material-ui/core/Zoom'; import Fab from '@material-ui/core/Fab'; import AddIcon from '@material-ui/icons/Add'; import EditIcon from '@material-ui/icons/Edit'; import UpIcon from '@material-ui/icons/KeyboardArrowUp'; import { green } from '@material-ui/core/colors'; import Box from '@material-ui/core/Box'; interface TabPanelProps { children?: React.ReactNode; dir?: string; index: any; value: any; } function TabPanel(props: TabPanelProps) { const { children, value, index, ...other } = props; return ( ); } function a11yProps(index: any) { return { id: `action-tab-${index}`, 'aria-controls': `action-tabpanel-${index}`, }; } const useStyles = makeStyles((theme: Theme) => createStyles({ root: { backgroundColor: theme.palette.background.paper, width: 500, position: 'relative', minHeight: 200, }, fab: { position: 'absolute', bottom: theme.spacing(2), right: theme.spacing(2), }, fabGreen: { color: theme.palette.common.white, backgroundColor: green[500], '&:hover': { backgroundColor: green[600], }, }, }), ); export default function FloatingActionButtonZoom() { const classes = useStyles(); const theme = useTheme(); const [value, setValue] = React.useState(0); const handleChange = (event: unknown, newValue: number) => { setValue(newValue); }; const handleChangeIndex = (index: number) => { setValue(index); }; const transitionDuration = { enter: theme.transitions.duration.enteringScreen, exit: theme.transitions.duration.leavingScreen, }; const fabs = [ { color: 'primary' as 'primary', className: classes.fab, icon: , label: 'Add', }, { color: 'secondary' as 'secondary', className: classes.fab, icon: , label: 'Edit', }, { color: 'inherit' as 'inherit', className: clsx(classes.fab, classes.fabGreen), icon: , label: 'Expand', }, ]; return (
Item One Item Two Item Three {fabs.map((fab, index) => ( {fab.icon} ))}
); }