source: src/layouts/auth/classic.tsx@ 057453c

main
Last change on this file since 057453c was 5d6f37a, checked in by Naum Shapkarovski <naumshapkarovski@…>, 7 weeks ago

add customer

  • Property mode set to 100644
File size: 2.0 KB
Line 
1// @mui
2import { alpha, useTheme } from '@mui/material/styles';
3import Box from '@mui/material/Box';
4import Stack from '@mui/material/Stack';
5import Typography from '@mui/material/Typography';
6// hooks
7import { useResponsive } from 'src/hooks/use-responsive';
8// theme
9import { bgGradient } from 'src/theme/css';
10// components
11import Logo from 'src/components/logo';
12
13// ----------------------------------------------------------------------
14
15type Props = {
16 title?: string;
17 image?: string;
18 children: React.ReactNode;
19};
20
21export default function AuthClassicLayout({ children, image, title }: Props) {
22 const theme = useTheme();
23
24 const mdUp = useResponsive('up', 'md');
25
26 const renderLogo = (
27 <Logo
28 sx={{
29 zIndex: 9,
30 position: 'absolute',
31 m: { xs: 2, md: 5 },
32 }}
33 />
34 );
35
36 const renderContent = (
37 <Stack
38 sx={{
39 width: 1,
40 mx: 'auto',
41 maxWidth: 480,
42 px: { xs: 2, md: 8 },
43 pt: { xs: 15, md: 20 },
44 pb: { xs: 15, md: 0 },
45 }}
46 >
47 {children}
48 </Stack>
49 );
50
51 const renderSection = (
52 <Stack
53 flexGrow={1}
54 spacing={10}
55 alignItems="center"
56 justifyContent="center"
57 sx={{
58 ...bgGradient({
59 color: alpha(
60 theme.palette.background.default,
61 theme.palette.mode === 'light' ? 0.88 : 0.94
62 ),
63 imgUrl: '/assets/background/overlay_2.jpg',
64 }),
65 }}
66 >
67 <Typography variant="h3" sx={{ maxWidth: 480, textAlign: 'center' }}>
68 {title || 'Hi, Welcome back'}
69 </Typography>
70
71 <Box
72 component="img"
73 alt="auth"
74 src={image || '/assets/illustrations/logo-color-inverse.png'}
75 sx={{
76 maxWidth: {
77 xs: 480,
78 lg: 560,
79 xl: 720,
80 },
81 }}
82 />
83 </Stack>
84 );
85
86 return (
87 <Stack
88 component="main"
89 direction="row"
90 sx={{
91 minHeight: '100vh',
92 }}
93 >
94 {renderLogo}
95
96 {mdUp && renderSection}
97
98 {renderContent}
99 </Stack>
100 );
101}
Note: See TracBrowser for help on using the repository browser.