diff --git a/src/assets/common.ts b/src/assets/common.ts index ec694cf..c8f9389 100644 --- a/src/assets/common.ts +++ b/src/assets/common.ts @@ -2,9 +2,12 @@ import { Link } from 'react-router-dom'; import { styled } from 'styled-components'; import { Palette } from 'styles/Palette'; -export const EntireContainer = styled.div<{ homebar?: boolean }>` +export const EntireContainer = styled.div<{ + homebar?: boolean; + background?: string; +}>` padding: 25px 30px; - background: ${Palette.White}; + background: ${({ background }) => (background ? background : Palette.White)}; height: ${({ homebar }) => homebar ? 'calc(100vh - 156px)' : 'calc(100vh - 60px)'}; overflow: auto; diff --git a/src/components/Homebar.tsx b/src/components/Homebar.tsx index 448f532..3994f05 100644 --- a/src/components/Homebar.tsx +++ b/src/components/Homebar.tsx @@ -11,10 +11,12 @@ import mypageOnJuni from '@assets/icons/mypage-on-juni.svg'; import mypageOnCyni from '@assets/icons/mypage-on-cyni.svg'; import Typo from 'styles/Typo'; import { useState } from 'react'; -import { Link } from 'react-router-dom'; +import { Link, useLocation } from 'react-router-dom'; const Homebar = () => { + const { pathname } = useLocation(); let userType = 2; //임시 변수 + const [icons, setIcons] = useState({ isAnsOn: false, isAskOn: false, @@ -22,34 +24,24 @@ const Homebar = () => { isMpgOn: false, }); - const handleClick = (iconName: string) => { - setIcons((prevState) => ({ - ...prevState, - isAnsOn: iconName === 'ans', - isAskOn: iconName === 'ask', - isJuicyOn: iconName === 'juicy', - isMpgOn: iconName === 'mpg', - })); - }; - return ( {userType == 1 ? ( - handleClick('ans')}> - + + 답변하기 ) : ( - handleClick('ask')}> - + + 질문하기 )} - handleClick('juicy')}> + { 주씨글 - handleClick('mpg')}> + {
내댓글
- + 4   개의 댓글 diff --git a/src/pages/Mypage/MyQna/index.tsx b/src/pages/Mypage/MyQna/index.tsx index 4cc59b9..8dbc0b5 100644 --- a/src/pages/Mypage/MyQna/index.tsx +++ b/src/pages/Mypage/MyQna/index.tsx @@ -92,7 +92,10 @@ export const MyQna = () => { {userType === 0 ? '내질문' : '내답변'} - + {text}   12 diff --git a/src/pages/Mypage/MyScrap/index.tsx b/src/pages/Mypage/MyScrap/index.tsx index 62b1591..7235d54 100644 --- a/src/pages/Mypage/MyScrap/index.tsx +++ b/src/pages/Mypage/MyScrap/index.tsx @@ -85,7 +85,7 @@ export const MyScrap = () => {
스크랩
- + 4   개의 스크랩 diff --git a/src/pages/Mypage/index.tsx b/src/pages/Mypage/index.tsx index 3517859..04844b7 100644 --- a/src/pages/Mypage/index.tsx +++ b/src/pages/Mypage/index.tsx @@ -30,7 +30,7 @@ export const Mypage = () => { > MY - + 안녕하세요