diff --git a/src/components/UserPage/SideBar.jsx b/src/components/UserPage/SideBar.jsx index 74407c6..ab05993 100644 --- a/src/components/UserPage/SideBar.jsx +++ b/src/components/UserPage/SideBar.jsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useState } from "react"; import { useNavigate } from "react-router-dom"; import styled from "styled-components"; import scoreIcon from "../../assets/img/userScore.svg"; @@ -10,6 +10,7 @@ import BgColor from "../Common/BgColor"; function SideBar() { const navigate = useNavigate(); + const [currentPage, setCurrentPage] = useState(window.location.pathname); const handleMenuClick = (url) => { navigate(url); @@ -18,31 +19,46 @@ function SideBar() { return ( - handleMenuClick("/user")}> + handleMenuClick("/user")} + >
내 경험치 아이콘 내 경험치
- handleMenuClick("/user/saved")}> + handleMenuClick("/user/saved")} + >
찜한 강좌 아이콘 찜한 강좌
- handleMenuClick("/user/learning")}> + handleMenuClick("/user/learning")} + >
수강 중 아이콘 수강 중
- handleMenuClick("/user/complete")}> + handleMenuClick("/user/complete")} + >
수강 완료 아이콘 수강 완료
- handleMenuClick("/user/edit")}> + handleMenuClick("/user/edit")} + >
프로필 수정 아이콘 프로필 수정 @@ -80,7 +96,8 @@ const Menu = styled.div` display: flex; justify-content: center; align-items: center; - background-color: white; + background-color: ${(props) => + props.isSelected ? "rgba(66, 168, 248, 0.1)" : "white"}; &:first-child { margin-top: 60px; }