Skip to content

Commit

Permalink
fixed background.color
Browse files Browse the repository at this point in the history
  • Loading branch information
shiloh4 committed Aug 22, 2024
1 parent 92aab17 commit ef5cb6b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.App {
text-align: center;
background: '#D2B48C'
}

.App-logo {
Expand Down Expand Up @@ -36,3 +37,7 @@
transform: rotate(360deg);
}
}

body {
background: '#D2B48C'
}
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ function App() {
const theme = useTheme();

return (
<div className="App">
<ThemeContextProvider theme={lightTheme}>
<Navbar />
{/* <Box sx={{ height: '10%' }}/> */}
<HomePage />
</ThemeContextProvider>
</div>
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Pages/HomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function HomePage() {
const isMobile = useMediaQuery(theme.breakpoints.down('sm'));

return(
<Box sx={{display: 'flex', justifyContent: 'center', borderWdith: 1}}>
<Box sx={{display: 'flex', justifyContent: 'center' }}>
<Banner/>
</Box>
);
Expand Down
2 changes: 2 additions & 0 deletions src/themeContextProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ export const ThemeContextProvider = ({ children }) => {

const toggleTheme = () => {
setMode((prevMode) => (prevMode === 'light' ? 'dark' : 'light'));

};

const theme = useMemo(() => (mode === 'light' ? createTheme(lightTheme) : createTheme(darkTheme)), [mode]);
document.body.style.backgroundColor = theme.palette.primary.main;

return (
<ThemeContext.Provider value={{ mode, toggleTheme }}>
Expand Down

0 comments on commit ef5cb6b

Please sign in to comment.