saleor-dashboard/src/components/Container.tsx
Dominik Żegleń 416d7d87f6
Improve theming (#1020)
* Remove unused code

* Move theme to separate directory

* Separate types

* Separate shadows

* Separate shadows

* Rename types

* Modularize code

* Do not pollute prototypes

* Fix missing import

* Aliast mui styles

* Import theming internally

* Fix types

* Fix override type
2021-03-30 09:40:18 +02:00

36 lines
816 B
TypeScript

import { makeStyles } from "@saleor/theme";
import classNames from "classnames";
import React from "react";
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)
}
}),
{
name: "Container"
}
);
interface ContainerProps {
className?: string;
}
export const Container: React.FC<ContainerProps> = props => {
const { className, ...rest } = props;
const classes = useStyles(props);
return <div className={classNames(classes.root, className)} {...rest} />;
};
Container.displayName = "Container";
export default Container;