-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from IT-Cotato/feat/COT-54-change-global-back…
…ground Feat/cot 54 change global background
- Loading branch information
Showing
7 changed files
with
1,422 additions
and
1,716 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React from 'react'; | ||
import { Box, Stack } from '@mui/material'; | ||
import { THEME_CHANGE_TRANSITION } from '@theme/constants/constants'; | ||
import { useTheme } from 'styled-components'; | ||
import lightBackgroundImage from '@/assets/light_background.svg'; | ||
import darkBackgroundImage from '@/assets/dark_background.svg'; | ||
import useCotatoTheme from '@/hooks/useCotatoTheme'; | ||
|
||
// | ||
// | ||
// | ||
|
||
const Background = () => { | ||
const theme = useTheme(); | ||
|
||
// | ||
const { theme: cotatoTheme } = useCotatoTheme(); | ||
|
||
// | ||
// | ||
// | ||
|
||
return ( | ||
<Stack | ||
sx={{ | ||
position: 'fixed', | ||
top: 0, | ||
left: 0, | ||
width: '100%', | ||
height: '100vh', | ||
zIndex: -1, | ||
backgroundRepeat: 'repeat', | ||
backgroundSize: 'cover', | ||
backgroundColor: theme.colors.common.white, | ||
transition: THEME_CHANGE_TRANSITION, | ||
}} | ||
> | ||
<Box | ||
component="img" | ||
src={cotatoTheme === 'light' ? lightBackgroundImage : darkBackgroundImage} | ||
sx={{ | ||
objectFit: 'cover', | ||
height: '100vh', | ||
}} | ||
/> | ||
</Stack> | ||
); | ||
}; | ||
|
||
export default Background; |
Oops, something went wrong.