saleor-dashboard/src/components/Container.tsx

36 lines
844 B
TypeScript
Raw Normal View History

2019-06-19 14:40:52 +00:00
import {
createStyles,
Theme,
withStyles,
WithStyles
} from "@material-ui/core/styles";
2019-08-09 11:14:35 +00:00
import classNames from "classnames";
2019-08-09 10:26:22 +00:00
import React from "react";
2019-06-19 14:40:52 +00:00
2019-10-28 16:16:49 +00:00
const styles = theme =>
2019-06-19 14:40:52 +00:00
createStyles({
root: {
[theme.breakpoints.up("lg")]: {
marginLeft: "auto",
marginRight: "auto",
maxWidth: theme.breakpoints.width("lg")
},
[theme.breakpoints.up("sm")]: {
2019-10-28 16:16:49 +00:00
padding: theme.spacing(0, 3)
2019-06-19 14:40:52 +00:00
},
2019-10-28 16:16:49 +00:00
padding: theme.spacing(0, 1)
2019-06-19 14:40:52 +00:00
}
});
interface ContainerProps extends WithStyles<typeof styles> {
className?: string;
}
export const Container = withStyles(styles, {
name: "Container"
})(({ classes, className, ...props }: ContainerProps) => (
<div className={classNames(classes.root, className)} {...props} />
));
Container.displayName = "Container";
export default Container;