wcz-layout 6.2.0 → 6.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of wcz-layout might be problematic. Click here for more details.

package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "wcz-layout",
3
3
  "license": "MIT",
4
4
  "author": "Dalibor Homola",
5
- "version": "6.2.0",
5
+ "version": "6.2.2",
6
6
  "main": "dist/src/index.js",
7
7
  "module": "dist/src/index.js",
8
8
  "exports": {
@@ -181,7 +181,7 @@ export const Layout: React.FC<LayoutProps> = ({ routes, colors, appVersion, user
181
181
  </Box>
182
182
  </Box>
183
183
 
184
- <DevelopmentBanner user={user} />
184
+ <DevelopmentBanner user={user} hasNavigationRoutes={hasNavigationRoutes} />
185
185
  {(isFetching || isMutating) && <LinearProgress sx={{ position: "fixed", top: { xs: 56, sm: 64 }, left: 0, right: 0 }} />}
186
186
  </ThemeProvider>
187
187
  );
@@ -1,16 +1,18 @@
1
1
  import { Close } from "@mui/icons-material";
2
- import { Fade, Grid, IconButton, Paper, Typography } from "@mui/material";
2
+ import { Fade, Grid2, IconButton, Paper, Typography } from "@mui/material";
3
3
  import { useEffect, useState } from "react";
4
4
  import { useTranslation } from "react-i18next";
5
5
  import { User } from "../../models/User";
6
6
  import { environment } from "../../utils/Helpers";
7
7
  import { hasRole } from "../../utils/UserService";
8
+ import { grey } from "@mui/material/colors";
8
9
 
9
10
  interface DevelopmentBannerProps {
10
11
  user: User;
12
+ hasNavigationRoutes: boolean;
11
13
  }
12
14
 
13
- export const DevelopmentBanner: React.FC<DevelopmentBannerProps> = ({ user }) => {
15
+ export const DevelopmentBanner: React.FC<DevelopmentBannerProps> = ({ user, hasNavigationRoutes }) => {
14
16
  const { t } = useTranslation();
15
17
  const [bannerOpen, setBannerOpen] = useState<boolean>(false);
16
18
 
@@ -23,19 +25,29 @@ export const DevelopmentBanner: React.FC<DevelopmentBannerProps> = ({ user }) =>
23
25
 
24
26
  return (
25
27
  <Fade appear={false} in={bannerOpen}>
26
- <Paper square variant="outlined" tabIndex={-1} sx={{ position: "fixed", bottom: 0, left: { xs: 0, sm: 67.7 }, right: 0, m: 0, p: 2, borderWidth: 0, borderTopWidth: 1 }} >
27
- <Grid container justifyContent="space-between" alignItems="center">
28
- <Grid item xs>
28
+ <Paper square variant="outlined" tabIndex={-1} sx={theme => ({
29
+ position: "fixed",
30
+ bottom: 0,
31
+ left: { xs: 0, sm: hasNavigationRoutes ? 68.7 : 0 },
32
+ right: 0,
33
+ m: 0,
34
+ p: 2,
35
+ borderWidth: 0,
36
+ borderTopWidth: 1,
37
+ bgcolor: theme.palette.mode === "dark" ? grey[900] : grey[100]
38
+ })}>
39
+ <Grid2 container justifyContent="space-between" alignItems="center">
40
+ <Grid2 size={10}>
29
41
  <Typography fontWeight="bold">{t("Layout.DevelopmentDialogTitle")}</Typography>
30
42
  <Typography variant="body2">{t("Layout.DevelopmentDialogContent")}</Typography>
31
- </Grid>
43
+ </Grid2>
32
44
 
33
- <Grid item xs={2} sx={{ p: 1, textAlign: "right" }}>
45
+ <Grid2 size={2} sx={{ p: 1, textAlign: "right" }}>
34
46
  <IconButton size="small" onClick={closeBanner}>
35
47
  <Close />
36
48
  </IconButton>
37
- </Grid>
38
- </Grid>
49
+ </Grid2>
50
+ </Grid2>
39
51
  </Paper>
40
52
  </Fade>
41
53
  );
@@ -1,8 +1,8 @@
1
1
  import { Stack, SxProps, Theme, Typography, TypographyProps } from "@mui/material";
2
2
 
3
3
  const stackSxProps = [
4
- "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "m", "mt", "mr", "mb", "ml",
5
- "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "p", "pt", "pr", "pb", "pl",
4
+ "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "m", "mt", "mr", "mb", "ml", "mx", "my",
5
+ "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "p", "pt", "pr", "pb", "pl", "px", "py",
6
6
  "flexGrow", "flexShrink", "flexBasis", "flexDirection", "alignItems", "justifyContent",
7
7
  "position", "zIndex", "top", "right", "bottom", "left",
8
8
  "gridGap", "gridColumnGap", "gridRowGap", "gridColumn", "gridRow", "gridAutoFlow",