From 1574624f690031c50efa705bcdccc8657882d2ad Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 12 Jun 2025 09:37:51 +0800 Subject: [PATCH] add a background component --- client/src/App.jsx | 16 ++---- .../Components/Layouts/AppLayout/index.jsx | 30 ++++++++++++ client/src/Components/Sidebar/index.jsx | 1 - client/src/Components/StarPrompt/index.jsx | 1 - client/src/Utils/Theme/constants.js | 7 +++ client/src/assets/Images/background.svg | 49 +++++++++++++++++++ 6 files changed, 91 insertions(+), 13 deletions(-) create mode 100644 client/src/Components/Layouts/AppLayout/index.jsx create mode 100644 client/src/assets/Images/background.svg diff --git a/client/src/App.jsx b/client/src/App.jsx index 7fb63ee61..b599890f1 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -10,6 +10,7 @@ import { logger } from "./Utils/Logger"; // Import the logger import { networkService } from "./main"; import { Routes } from "./Routes"; import WalletProvider from "./Components/WalletProvider"; +import AppLayout from "./Components/Layouts/AppLayout"; function App() { const mode = useSelector((state) => state.ui.mode); @@ -27,17 +28,10 @@ function App() { - { - return { - body: { - backgroundImage: `radial-gradient(circle, ${palette.gradient.color1}, ${palette.gradient.color2}, ${palette.gradient.color3}, ${palette.gradient.color4}, ${palette.gradient.color5})`, - color: palette.primary.contrastText, - }, - }; - }} - /> - + + + + diff --git a/client/src/Components/Layouts/AppLayout/index.jsx b/client/src/Components/Layouts/AppLayout/index.jsx new file mode 100644 index 000000000..564012d72 --- /dev/null +++ b/client/src/Components/Layouts/AppLayout/index.jsx @@ -0,0 +1,30 @@ +import Box from "@mui/material/Box"; +import PropTypes from "prop-types"; +import { useTheme } from "@emotion/react"; +import BackgroundSVG from "../../../assets/Images/background.svg"; + +const AppLayout = ({ children }) => { + const theme = useTheme(); + + return ( + + {children} + + ); +}; + +AppLayout.propTypes = { + children: PropTypes.node, +}; + +export default AppLayout; diff --git a/client/src/Components/Sidebar/index.jsx b/client/src/Components/Sidebar/index.jsx index 6be67a43d..f487148f5 100644 --- a/client/src/Components/Sidebar/index.jsx +++ b/client/src/Components/Sidebar/index.jsx @@ -231,7 +231,6 @@ function Sidebar() { borderRight: `1px solid ${theme.palette.primary.lowContrast}`, borderColor: theme.palette.primary.lowContrast, borderRadius: 0, - backgroundColor: theme.palette.primary.main, "& :is(p, span, .MuiListSubheader-root)": { /* Text color for unselected menu items and menu headings diff --git a/client/src/Components/StarPrompt/index.jsx b/client/src/Components/StarPrompt/index.jsx index 8bf434085..64fce1d3f 100644 --- a/client/src/Components/StarPrompt/index.jsx +++ b/client/src/Components/StarPrompt/index.jsx @@ -33,7 +33,6 @@ const StarPrompt = ({ repoUrl = "https://github.com/bluewave-labs/checkmate" }) borderBottom: `1px solid ${theme.palette.primary.lowContrast}`, borderRadius: 0, gap: theme.spacing(1.5), - backgroundColor: theme.palette.primary.main, }} > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file