Skip to content

Commit

Permalink
Merge branch 'feat/COT-54-change-global-background' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Donghyun Hwang committed Dec 30, 2024
2 parents 90a9e5c + 235c041 commit 5a7f0c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/Background.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Background = () => {
const theme = useTheme();

//
const { DefaultTheme } = useCotatoTheme();
const { theme: cotatoTheme } = useCotatoTheme();

//
//
Expand All @@ -37,7 +37,7 @@ const Background = () => {
>
<Box
component="img"
src={DefaultTheme === 'light' ? lightBackgroundImage : darkBackgroundImage}
src={cotatoTheme === 'light' ? lightBackgroundImage : darkBackgroundImage}
sx={{
objectFit: 'cover',
height: '100vh',
Expand Down
5 changes: 3 additions & 2 deletions src/hooks/useCotatoTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import React from 'react';
//

function useCotatoTheme() {
const defaultTheme = localStorage.getItem('theme') || COTATO_DARK_THEME;
const [theme, setTheme] = React.useState(defaultTheme);
const currentTheme = localStorage.getItem('theme') || COTATO_DARK_THEME;
const [theme, setTheme] = React.useState(currentTheme);

/**
*
Expand Down Expand Up @@ -39,6 +39,7 @@ function useCotatoTheme() {
//
return {
DefaultTheme: theme,
theme: currentTheme,
onChangeTheme,
};
}
Expand Down

0 comments on commit 5a7f0c4

Please sign in to comment.