Refactor common components

master
Tudor Stanciu 2024-03-25 02:37:54 +02:00
parent 33d61de6d3
commit 799d95ab23
2 changed files with 14 additions and 15 deletions

View File

@ -10,7 +10,7 @@ const NotAllowed = () => {
sx={{
width: "100%",
"& > * + *": {
marginTop: 1 // theme.spacing(1)
marginTop: 1
}
}}
>

View File

@ -1,14 +1,13 @@
import React from "react";
import PropTypes from "prop-types";
import { makeStyles } from "@mui/material/styles";
import { Typography } from "@mui/material";
import { Typography, Box } from "@mui/material";
const useStyles = makeStyles(theme => ({
const styles = {
box: {
display: "flex",
justifyContent: "space-between",
marginBottom: theme.spacing(1),
marginTop: theme.spacing(0)
marginBottom: 1,
marginTop: 0
},
title: {
display: "flex",
@ -16,22 +15,22 @@ const useStyles = makeStyles(theme => ({
flexDirection: "column",
minHeight: "40px"
},
titleText: { textTransform: "uppercase" }
}));
titleText: {
textTransform: "uppercase"
}
};
const PageTitle = ({ text, toolBar, navigation }) => {
const classes = useStyles();
return (
<div className={classes.box}>
<Box sx={styles.box}>
{navigation && navigation}
<div className={classes.title}>
<Typography className={classes.titleText} variant="h3" size="sm">
<Box sx={styles.title}>
<Typography sx={styles.titleText} variant="h3" size="sm">
{text}
</Typography>
</div>
</Box>
{toolBar && toolBar}
</div>
</Box>
);
};