Skip to content

Commit

Permalink
[docs] Add markdown code to Interactive Grid (#12333)
Browse files Browse the repository at this point in the history
  • Loading branch information
itelo authored and oliviertassinari committed Jul 30, 2018
1 parent 73b0ca7 commit c0cf90f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/src/pages/layout/grid/InteractiveGrid.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import MarkdownElement from '@material-ui/docs/MarkdownElement';
import Grid from '@material-ui/core/Grid';
import FormControl from '@material-ui/core/FormControl';
import FormLabel from '@material-ui/core/FormLabel';
Expand Down Expand Up @@ -42,6 +43,18 @@ class InteractiveGrid extends React.Component {
render() {
const { classes } = this.props;
const { alignItems, direction, justify } = this.state;

const code = `
\`\`\`jsx
<Grid
container
direction="${direction}"
justify="${justify}"
alignItems="${alignItems}"
>
\`\`\`
`;

return (
<Grid container className={classes.root}>
<Grid item xs={12}>
Expand Down Expand Up @@ -141,6 +154,9 @@ class InteractiveGrid extends React.Component {
</Grid>
</Paper>
</Grid>
<Grid item xs={12}>
<MarkdownElement text={code} />
</Grid>
</Grid>
);
}
Expand Down

0 comments on commit c0cf90f

Please sign in to comment.