diff --git a/bowwowcare/src/components/Header.js b/bowwowcare/src/components/Header.js index 546984d..79cbe5b 100644 --- a/bowwowcare/src/components/Header.js +++ b/bowwowcare/src/components/Header.js @@ -8,6 +8,7 @@ import "../font.css"; import { ThemeContext } from './../context/ThemeProvider.js'; import { colorVariants } from '../utils/Dictionary'; +import { isProfile } from '../utils/Status'; function Header() { const [themeMode, setThemeMode] = useContext(ThemeContext); @@ -29,10 +30,8 @@ function Header() { } const handleUser = (e) => { - navigate("user"); + navigate("/user"); } - - const isProfile = () => JSON.parse(localStorage.getItem("userImg")); return (
diff --git a/bowwowcare/src/context/ThemeProvider.js b/bowwowcare/src/context/ThemeProvider.js index 2b61c65..25b0b29 100644 --- a/bowwowcare/src/context/ThemeProvider.js +++ b/bowwowcare/src/context/ThemeProvider.js @@ -1,6 +1,6 @@ import { createContext, useState, useEffect } from "react"; import userService from "../services/user.service"; -import { isLogin } from "../utils/isLogin"; +import { isLogin } from "../utils/Status"; export const ThemeContext = createContext({}); @@ -9,7 +9,6 @@ function ThemeProvider({ children }) { const [myTheme, setMyTheme] = useState(0); const [ThemeMode, setThemeMode] = useState(theme[0]); - useEffect(() => { if(isLogin()){ userService.getUserBoard().then((response) => { diff --git a/bowwowcare/src/theme/theme.js b/bowwowcare/src/theme/theme.js deleted file mode 100644 index c44ed4b..0000000 --- a/bowwowcare/src/theme/theme.js +++ /dev/null @@ -1,23 +0,0 @@ -export const primaryTheme = { - primary: '#38A8AC', - secondary: "#E5EEC1", -}; - -// TODO: 색상 변경 -// 일단은 보라 -export const secondaryTheme = { - primary: '#7E57C2', - secondary:'#EDE7F6' -}; - -// 일단은 검정 -export const thirdTheme = { - primary: '#424242', - secondary:'#F5F5F5' -}; - -export const theme = { - primaryTheme, - secondaryTheme, - thirdTheme -} \ No newline at end of file diff --git a/bowwowcare/src/utils/Status.js b/bowwowcare/src/utils/Status.js new file mode 100644 index 0000000..2f00a49 --- /dev/null +++ b/bowwowcare/src/utils/Status.js @@ -0,0 +1,2 @@ +export const isLogin = () => !!localStorage.getItem("user"); +export const isProfile = () => JSON.parse(localStorage.getItem("userImg")); \ No newline at end of file diff --git a/bowwowcare/src/utils/isLogin.js b/bowwowcare/src/utils/isLogin.js deleted file mode 100644 index b56fb39..0000000 --- a/bowwowcare/src/utils/isLogin.js +++ /dev/null @@ -1 +0,0 @@ -export const isLogin = () => !!localStorage.getItem("user"); \ No newline at end of file diff --git a/bowwowcare/src/views/HomePage/HomePage.js b/bowwowcare/src/views/HomePage/HomePage.js index 400ff55..60ae5a2 100644 --- a/bowwowcare/src/views/HomePage/HomePage.js +++ b/bowwowcare/src/views/HomePage/HomePage.js @@ -3,7 +3,7 @@ import { useNavigate } from "react-router-dom"; import axios from "axios"; import { API_URL } from "../../Config"; import authHeader from "../../services/auth-header"; -import { isLogin } from "../../utils/isLogin"; +import { isLogin } from "../../utils/Status"; import Header from "../../components/Header"; import PetList from "./PetList/PetList";