From 799d95ab234c30a7f2e6855fac9e91106c4c009c Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Mon, 25 Mar 2024 02:37:54 +0200 Subject: [PATCH] Refactor common components --- frontend/src/components/common/NotAllowed.js | 2 +- frontend/src/components/common/PageTitle.js | 27 ++++++++++---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/common/NotAllowed.js b/frontend/src/components/common/NotAllowed.js index d6d665a..b5bbb8f 100644 --- a/frontend/src/components/common/NotAllowed.js +++ b/frontend/src/components/common/NotAllowed.js @@ -10,7 +10,7 @@ const NotAllowed = () => { sx={{ width: "100%", "& > * + *": { - marginTop: 1 // theme.spacing(1) + marginTop: 1 } }} > diff --git a/frontend/src/components/common/PageTitle.js b/frontend/src/components/common/PageTitle.js index 9859396..6f94fea 100644 --- a/frontend/src/components/common/PageTitle.js +++ b/frontend/src/components/common/PageTitle.js @@ -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 ( -
+ {navigation && navigation} -
- + + {text} -
+
{toolBar && toolBar} -
+ ); };