Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(react-grid-material-ui): get rid of the Paper wrapper #487

Merged
merged 6 commits into from Nov 18, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/dx-react-demos/src/demo-viewer/demo-renderer.jsx
@@ -1,6 +1,8 @@
import React from 'react';
import PropTypes from 'prop-types';

import { Paper } from 'material-ui';

import { themes, demos } from '../demo-registry';

export const DemoRenderer = ({
Expand All @@ -15,11 +17,19 @@ export const DemoRenderer = ({
const { DemoContainer } = themes
.find(({ name: theme }) => theme === currentTheme);

return (
const demo = (
<DemoContainer>
<Component />
</DemoContainer>
);
if (currentTheme === 'material-ui') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you write it here? There is DemoContainer for that purposes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, I wrap all elements in a demo with Paper. It makes sense for the Theming and Column Chooser ones. It looks like, I should wrap only Grid...

return (
<Paper>
{demo}
</Paper>
);
}
return demo;
};

DemoRenderer.propTypes = {
Expand Down
5 changes: 2 additions & 3 deletions packages/dx-react-grid-material-ui/src/templates/layout.jsx
@@ -1,7 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from 'material-ui/styles';
import { Paper } from 'material-ui';

const styles = theme => ({
headingPanel: {
Expand All @@ -20,11 +19,11 @@ export const Root = ({
bodyTemplate,
footerTemplate,
}) => (
<Paper>
<div>
{headerTemplate()}
{bodyTemplate()}
{footerTemplate()}
</Paper>
</div>
);

Root.propTypes = {
Expand Down