Added paper to collections.

This commit is contained in:
WildScotsmen 2018-12-10 17:25:42 -05:00
parent 37eba8454a
commit d879236e67
1 changed files with 29 additions and 6 deletions

View File

@ -1,6 +1,19 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import Grid from '@material-ui/core/Grid'; import Grid from '@material-ui/core/Grid';
import FlameLinkCollectionStructure from './FlameLinkCollectionStructure'; import FlameLinkCollectionStructure from './FlameLinkCollectionStructure';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';
const styles = theme => ({
root: {
...theme.mixins.gutters(),
margin: theme.spacing.unit * 2,
paddingTop: theme.spacing.unit * 2,
paddingBottom: theme.spacing.unit * 2,
width: '100%'
},
});
class FlameLinkCollectionComponentCreations extends Component { class FlameLinkCollectionComponentCreations extends Component {
@ -10,16 +23,26 @@ class FlameLinkCollectionComponentCreations extends Component {
} }
createCollectionComponents(num) { createCollectionComponents(num) {
return <FlameLinkCollectionStructure schemaData={this[0]} schemaContent={this[1]} field={this[0][num]} type={this[0][num].type} key={this[0][num].key} /> return (
<FlameLinkCollectionStructure schemaData={this[0]} schemaContent={this[1]} field={this[0][num]} type={this[0][num].type} key={this[0][num].key} />
);
} }
render() { render() {
const { classes } = this.props;
return ( return (
<Paper className={classes.root} elevation={4}>
<Grid container> <Grid container>
{this.createCollectionEntries(this.props.schemaData, this.props.schemaContent, this.props.arr)} {this.createCollectionEntries(this.props.schemaData, this.props.schemaContent, this.props.arr)}
</Grid> </Grid>
</Paper>
); );
} }
} }
export default FlameLinkCollectionComponentCreations; FlameLinkCollectionComponentCreations.propTypes = {
classes: PropTypes.object.isRequired,
};
export default withStyles(styles)(FlameLinkCollectionComponentCreations);