Skip to content

Commit

Permalink
[docs] Display the default theme (#9859)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Jan 13, 2018
1 parent e5d244b commit 8ddc204
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/src/pages/customization/ThemeDefault.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Inspector from 'react-inspector';
import { withStyles, withTheme } from 'material-ui/styles';
import { withStyles, withTheme, createMuiTheme } from 'material-ui/styles';
import { FormControlLabel } from 'material-ui/Form';
import Switch from 'material-ui/Switch';

Expand All @@ -20,9 +20,16 @@ class ThemeDefault extends React.Component {
};

render() {
const { classes, theme } = this.props;
const { classes, theme: docsTheme } = this.props;
const { checked } = this.state;

const theme = createMuiTheme({
palette: {
type: docsTheme.palette.type,
},
direction: docsTheme.direction,
});

// Expose the theme as a global variable so people can play with it.
if (process.browser) {
window.theme = theme;
Expand Down

0 comments on commit 8ddc204

Please sign in to comment.