import React, { Component } from 'react'; import { fade } from '@material-ui/core/styles/colorManipulator'; import { withStyles } from '@material-ui/core/styles'; import withWidth, { isWidthDown } from '@material-ui/core/withWidth'; import Typography from '@material-ui/core/Typography'; import IconButton from '@material-ui/core/IconButton'; import Button from '@material-ui/core/Button'; import GridList from '@material-ui/core/GridList'; import GridListTile from '@material-ui/core/GridListTile'; import GridListTileBar from '@material-ui/core/GridListTileBar'; import Dialog from '@material-ui/core/Dialog'; import DialogActions from '@material-ui/core/DialogActions'; import DialogContent from '@material-ui/core/DialogContent'; import DialogTitle from '@material-ui/core/DialogTitle'; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faExpandAlt } from "@fortawesome/free-solid-svg-icons"; const styles = theme => ({ expand: { '&:hover': { color: theme.palette.primary.main, }, '&:active': { color: theme.palette.primary.main, }, color: theme.palette.text.primary }, multiGridListTile: { background: fade(theme.palette.secondary.main, 0.5), height: '30px' }, multiGridListTileTitle: { color: theme.palette.text.primary } }); class Hardware extends Component { state = { open: false, title: '', url: '' }; handleClickOpen = (title, url) => { this.setState({open: true, title, url}); }; handleClose = () => { this.setState({open: false, title: '', url: ''}); }; render() { var cols = isWidthDown('md', this.props.width) ? isWidthDown('sm', this.props.width) ? isWidthDown('xs', this.props.width) ? 2 : 3 : 4 : 6; return (
Für die Umsetzung benötigst du folgende Hardware: {this.props.picture.map((picture,i) => ( {picture} this.handleClickOpen(picture, `/media/hardware/${picture}.png`)}/> {picture}
} actionIcon={ this.handleClickOpen(picture, `/media/hardware/${picture}.png`)}> } /> ))} Hardware: {this.state.title} {this.state.title}/ ); }; } export default withWidth()(withStyles(styles, { withTheme: true })(Hardware));