2019-09-02 13:52:43 +00:00
|
|
|
import backgroundArt from "@assets/images/login-background.svg";
|
|
|
|
import saleorDarkLogo from "@assets/images/logo-dark.svg";
|
|
|
|
import saleorLightLogo from "@assets/images/logo-light.svg";
|
2022-03-09 08:56:55 +00:00
|
|
|
import { makeStyles, useTheme } from "@saleor/macaw-ui";
|
2020-05-14 09:30:32 +00:00
|
|
|
import React from "react";
|
|
|
|
import SVG from "react-inlinesvg";
|
2019-09-02 13:52:43 +00:00
|
|
|
|
|
|
|
const useStyles = makeStyles(
|
2019-10-28 16:16:49 +00:00
|
|
|
theme => ({
|
2022-01-28 12:34:20 +00:00
|
|
|
footer: {
|
|
|
|
position: "absolute",
|
|
|
|
bottom: theme.spacing(4)
|
|
|
|
},
|
2019-09-02 13:52:43 +00:00
|
|
|
logo: {
|
2020-11-27 16:32:12 +00:00
|
|
|
display: "block",
|
|
|
|
height: 40,
|
|
|
|
marginBottom: theme.spacing(4)
|
2019-09-02 13:52:43 +00:00
|
|
|
},
|
|
|
|
mainPanel: {
|
|
|
|
[theme.breakpoints.down("sm")]: {
|
2019-10-28 16:16:49 +00:00
|
|
|
padding: theme.spacing(2)
|
2019-09-02 13:52:43 +00:00
|
|
|
},
|
|
|
|
background: theme.palette.background.paper,
|
|
|
|
display: "flex",
|
|
|
|
flexDirection: "column",
|
|
|
|
height: "100vh",
|
|
|
|
justifyContent: "center",
|
2022-01-28 12:34:20 +00:00
|
|
|
padding: theme.spacing(5, 6, 4, 6),
|
2019-09-02 13:52:43 +00:00
|
|
|
width: "100%"
|
|
|
|
},
|
|
|
|
mainPanelContent: {
|
|
|
|
[theme.breakpoints.up("xs")]: {
|
|
|
|
width: "100%"
|
|
|
|
},
|
|
|
|
[theme.breakpoints.up("sm")]: {
|
|
|
|
width: 328
|
|
|
|
},
|
|
|
|
"@media (min-width: 1440px)": {
|
2022-01-28 12:34:20 +00:00
|
|
|
width: 380
|
2019-09-02 13:52:43 +00:00
|
|
|
},
|
|
|
|
margin: "auto",
|
|
|
|
width: "100%"
|
|
|
|
},
|
|
|
|
root: {
|
|
|
|
[theme.breakpoints.up("lg")]: {
|
2022-01-28 12:34:20 +00:00
|
|
|
gridTemplateColumns: "560px 1fr"
|
2019-09-02 13:52:43 +00:00
|
|
|
},
|
|
|
|
"@media (min-width: 1440px)": {
|
2022-01-28 12:34:20 +00:00
|
|
|
gridTemplateColumns: "780px 1fr"
|
2019-09-02 13:52:43 +00:00
|
|
|
},
|
|
|
|
display: "grid",
|
|
|
|
gridTemplateColumns: "1fr",
|
2022-01-28 12:34:20 +00:00
|
|
|
gap: theme.spacing(3),
|
2019-09-02 13:52:43 +00:00
|
|
|
height: "100vh",
|
|
|
|
overflow: "hidden",
|
2022-01-28 12:34:20 +00:00
|
|
|
position: "relative",
|
2019-09-02 13:52:43 +00:00
|
|
|
width: "100vw"
|
|
|
|
},
|
|
|
|
sidebar: {
|
|
|
|
[theme.breakpoints.up("lg")]: {
|
2022-01-28 12:34:20 +00:00
|
|
|
alignItems: "center",
|
|
|
|
display: "flex"
|
2019-09-02 13:52:43 +00:00
|
|
|
},
|
|
|
|
display: "none"
|
|
|
|
},
|
|
|
|
sidebarArt: {
|
|
|
|
"& svg": {
|
|
|
|
width: "100%"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
{
|
|
|
|
name: "Layout"
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
const Layout: React.FC = props => {
|
|
|
|
const { children } = props;
|
|
|
|
|
|
|
|
const classes = useStyles(props);
|
2021-07-21 08:59:52 +00:00
|
|
|
const { themeType } = useTheme();
|
2019-09-02 13:52:43 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={classes.root}>
|
2022-01-28 12:34:20 +00:00
|
|
|
<div className={classes.mainPanel}>
|
|
|
|
<SVG
|
|
|
|
className={classes.logo}
|
|
|
|
src={themeType === "dark" ? saleorDarkLogo : saleorLightLogo}
|
|
|
|
/>
|
|
|
|
<div className={classes.mainPanelContent}>{children}</div>
|
|
|
|
<footer className={classes.footer}>
|
|
|
|
©2021 Saleor Commerce. All rights reserved
|
|
|
|
</footer>
|
|
|
|
</div>
|
2019-09-02 13:52:43 +00:00
|
|
|
<div className={classes.sidebar}>
|
|
|
|
<SVG className={classes.sidebarArt} src={backgroundArt} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
Layout.displayName = "Layout";
|
|
|
|
export default Layout;
|