saleor-dashboard/src/components/Container.tsx

32 lines
768 B
TypeScript
Raw Normal View History

2019-10-30 14:34:24 +00:00
import { makeStyles } 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-30 14:34:24 +00:00
const useStyles = makeStyles(theme => ({
root: {
[theme.breakpoints.up("lg")]: {
marginLeft: "auto",
marginRight: "auto",
maxWidth: theme.breakpoints.width("lg")
},
[theme.breakpoints.up("sm")]: {
padding: theme.spacing(0, 3)
},
padding: theme.spacing(0, 1)
}
}));
2019-06-19 14:40:52 +00:00
2019-10-30 14:34:24 +00:00
interface ContainerProps {
2019-06-19 14:40:52 +00:00
className?: string;
}
2019-10-30 14:34:24 +00:00
export const Container: React.FC<ContainerProps> = props => {
const { className, ...rest } = props;
const classes = useStyles(props);
return <div className={classNames(classes.root, className)} {...rest} />;
};
2019-06-19 14:40:52 +00:00
Container.displayName = "Container";
export default Container;