diff --git a/frontend/src/components/NavBar/MypageNavBar.tsx b/frontend/src/components/NavBar/MypageNavBar.tsx new file mode 100644 index 0000000..21db993 --- /dev/null +++ b/frontend/src/components/NavBar/MypageNavBar.tsx @@ -0,0 +1,65 @@ +import logo from 'images/logo.png'; +import { useNavigate } from 'react-router-dom'; + +function QuesNavBar() { + const navigate = useNavigate(); + const goToQueslistPage = () => { + navigate('/queslistpage'); + }; + const goToMain = () => { + navigate('/mainpage'); + }; + const goToQues = () => { + navigate('/quespage'); + }; + const goToPrivateQues = () => { + navigate('/privatequespage'); + }; + const goToMypage = () => { + navigate('/mypage'); + }; + + return ( +
+
+ + + + + +
+
+ ); +} + +export default QuesNavBar; diff --git a/frontend/src/components/NavBar/NavBar.tsx b/frontend/src/components/NavBar/NavBar.tsx index 557967b..6059362 100644 --- a/frontend/src/components/NavBar/NavBar.tsx +++ b/frontend/src/components/NavBar/NavBar.tsx @@ -7,7 +7,7 @@ function NavBar() { navigate('/queslistpage'); }; const goToMain = () => { - navigate('/mainpage'); + navigate('/'); }; const goToQues = () => { navigate('/quespage'); diff --git a/frontend/src/components/NavBar/PrivateQuesNavBar.tsx b/frontend/src/components/NavBar/PrivateQuesNavBar.tsx index 6f99cde..0794639 100644 --- a/frontend/src/components/NavBar/PrivateQuesNavBar.tsx +++ b/frontend/src/components/NavBar/PrivateQuesNavBar.tsx @@ -50,13 +50,13 @@ function PrivateQuesNavBar() { > 질문게시판 - {/* */} + ); diff --git a/frontend/src/components/NavBar/QuesListNavBar.tsx b/frontend/src/components/NavBar/QuesListNavBar.tsx index d733eac..57a514a 100644 --- a/frontend/src/components/NavBar/QuesListNavBar.tsx +++ b/frontend/src/components/NavBar/QuesListNavBar.tsx @@ -50,13 +50,13 @@ function QuesListNavBar() { > 질문게시판 - {/* */} + ); diff --git a/frontend/src/components/NavBar/QuesNavBar.tsx b/frontend/src/components/NavBar/QuesNavBar.tsx index f98dc99..6266385 100644 --- a/frontend/src/components/NavBar/QuesNavBar.tsx +++ b/frontend/src/components/NavBar/QuesNavBar.tsx @@ -50,13 +50,13 @@ function QuesNavBar() { > 질문게시판 - {/* */} + ); diff --git a/frontend/src/components/Ques.tsx b/frontend/src/components/Ques.tsx index e7966f1..d6e8294 100644 --- a/frontend/src/components/Ques.tsx +++ b/frontend/src/components/Ques.tsx @@ -27,10 +27,16 @@ function Ques({ count, title, date, type, postId, tags }: Props) { {/* 답변 수 */}
-
-

{count}

-

답변

-
+ {type === 'QUESTION' ? ( +
+

{count}

+

답변

+
+ ) : ( +
+

멘토링 예정

+
+ )}
{/* 질문 제목 */} diff --git a/frontend/src/page/MainPage2.tsx b/frontend/src/page/MainPage2.tsx deleted file mode 100644 index ffcfde0..0000000 --- a/frontend/src/page/MainPage2.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import 'tailwindcss/tailwind.css'; -import 'utils/pageStyle.css'; -import ColorSystem from 'utils/ColorSystem'; -import NavBar from 'components/NavBar/NavBar'; -import MainImage from '../images/aha.png'; - -function MainPage2() { - return ( -
- -
-
- 메인이미지 -
- - 분야별 멘토링 - - - 최근에 해결된 질문 - -
-
- ); -} - -export default MainPage2; diff --git a/frontend/src/page/MentoringPage.tsx b/frontend/src/page/MentoringPage.tsx index d0f9980..560b2ba 100644 --- a/frontend/src/page/MentoringPage.tsx +++ b/frontend/src/page/MentoringPage.tsx @@ -18,6 +18,7 @@ import 'monaco-editor/esm/vs/basic-languages/java/java.contribution'; import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution'; import 'monaco-editor/esm/vs/basic-languages/cpp/cpp.contribution'; import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution'; +import EndIndex from 'components/Index/EndIndex'; function MentoringPage() { document.documentElement.setAttribute('data-color-mode', 'light'); @@ -143,7 +144,7 @@ function MentoringPage() { return (
{/* 상단바 */} @@ -207,7 +208,25 @@ function MentoringPage() { CONTENT
+ {/* 컴파일러 실행 버튼 */} +
+ {/* FIXME : 컴파일러 api 호출하는 함수 구현 */} + +
+ {/* 컴파일러 결과 */}
+
+
+ {/* 추후 구현 예정 */} + + 컴파일러 결과 + +
+ + RESULT +
+
+
diff --git a/frontend/src/page/MyPage.tsx b/frontend/src/page/MyPage.tsx index 88f62d5..869c48f 100644 --- a/frontend/src/page/MyPage.tsx +++ b/frontend/src/page/MyPage.tsx @@ -1,7 +1,7 @@ import 'tailwindcss/tailwind.css'; import 'utils/pageStyle.css'; import ColorSystem from 'utils/ColorSystem'; -import NavBar from 'components/NavBar/NavBar'; +import MypageNavBar from 'components/NavBar/MypageNavBar'; import { useEffect, useState } from 'react'; import Box from '@mui/material/Box'; import Tab from '@mui/material/Tab'; @@ -10,11 +10,11 @@ import TabList from '@mui/lab/TabList'; import TabPanel from '@mui/lab/TabPanel'; import BasicProfile from 'images/BasicProfile.png'; import pencil from 'images/pencil.png'; -// import Tag from 'components/Tags/Tag'; import ChatBox from 'components/ChatBox'; import Profile from 'components/Profile'; import axios from 'axios'; import { useDispatch } from 'react-redux'; +import Ques from 'components/Ques'; import { setUserName } from '../components/redux/userSlice'; function MyPage() { @@ -27,6 +27,8 @@ function MyPage() { const [menteeChatInfo, setMenteeChatInfo] = useState([]); const [mentorCharInfo, setMentorChatInfo] = useState([]); const [profileInfo, setProfileInfo] = useState(''); + const [userId, setUserId] = useState(0); + const [userPostInfo, setUserPostInfo] = useState([]); const dispatch = useDispatch(); @@ -64,6 +66,7 @@ function MyPage() { .get(`/api/v1/users/info`) .then((res) => { setProfileInfo(res.data.data.name); + setUserId(res.data.data.userId); dispatch(setUserName(res.data.data.name)); }) .catch((error) => { @@ -72,13 +75,27 @@ function MyPage() { })(); }, []); + useEffect(() => { + (async () => { + await axios + .get(`/api/v1/posts/mypages/${userId}`) + .then((res) => { + console.log(res.data.data); + setUserPostInfo(res.data.data); + }) + .catch((error) => { + console.log(error); + }); + })(); + }, [userId]); + return (
{/* 상단바 */} - + {/* 유저 이름과 프로필 사진 */}
@@ -119,7 +136,17 @@ function MyPage() { >
- 추후 업데이트 될 예정입니다. + {userPostInfo.map((data: any) => ( + + ))}
diff --git a/frontend/src/page/QuesListPage.tsx b/frontend/src/page/QuesListPage.tsx index 94cbc77..31cb622 100644 --- a/frontend/src/page/QuesListPage.tsx +++ b/frontend/src/page/QuesListPage.tsx @@ -31,9 +31,7 @@ function QuesListPage() { const pageNumber = searchParams.get('page'); (async () => { await axios - .get( - `/api/v1/posts?page=${pageNumber}`, - ) + .get(`/api/v1/posts?page=${pageNumber}`) .then((res) => { setQuesInfo(res.data.data); })