From 26b5d1cda7c88aad627ef0296f90ee0664d39805 Mon Sep 17 00:00:00 2001 From: JiwonShin Date: Thu, 9 May 2024 03:46:14 +0900 Subject: [PATCH 1/2] =?UTF-8?q?(#285)style:=20UI=20=EA=B0=9C=EC=84=A0=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=A0=81=EC=9A=A9=ED=95=A9?= =?UTF-8?q?=EB=8B=88=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../noContentsComponents.scss | 8 ++++-- .../notificationPage/notificationPage.scss | 1 + .../pages/searchPage/companyInfoPage.scss | 7 ++++- .../pages/postPage/questionDetailPage.tsx | 2 +- .../pages/searchPage/companyInfoPage.tsx | 5 ++-- .../pages/searchPage/searchResultPage.tsx | 2 +- .../ui/myPageSelection/myAnswer.tsx | 6 +++-- .../ui/myPageSelection/myQuestion.tsx | 5 +++- .../noContentsComponent.tsx | 26 ++++++++++++------- 9 files changed, 43 insertions(+), 19 deletions(-) diff --git a/src/asset/sass/etc/noContentsComponent/noContentsComponents.scss b/src/asset/sass/etc/noContentsComponent/noContentsComponents.scss index abb93f30..e8395513 100644 --- a/src/asset/sass/etc/noContentsComponent/noContentsComponents.scss +++ b/src/asset/sass/etc/noContentsComponent/noContentsComponents.scss @@ -1,5 +1,5 @@ .no-contents-wrapper { - width: 700px; + width: 550px; height: 25rem; display: flex; flex-direction: column; @@ -18,7 +18,6 @@ width: 11px; height: 11px; margin-right: 1rem; - overflow: scroll; } .no-component-plus-container { @@ -37,6 +36,7 @@ color: #808080; font-family: Pretendard-Medium; letter-spacing: -1px; + } .no-component-title { @@ -46,3 +46,7 @@ font-family: Pretendard-Bold; letter-spacing: -1px; } + +.my-component-css{ + margin-bottom:6rem; +} \ No newline at end of file diff --git a/src/asset/sass/pages/notificationPage/notificationPage.scss b/src/asset/sass/pages/notificationPage/notificationPage.scss index 7d617fd2..75544c32 100644 --- a/src/asset/sass/pages/notificationPage/notificationPage.scss +++ b/src/asset/sass/pages/notificationPage/notificationPage.scss @@ -29,6 +29,7 @@ display: flex; justify-content: center; align-items: center; + cursor : pointer; } .notification-controls { diff --git a/src/asset/sass/pages/searchPage/companyInfoPage.scss b/src/asset/sass/pages/searchPage/companyInfoPage.scss index f698d829..129eb371 100644 --- a/src/asset/sass/pages/searchPage/companyInfoPage.scss +++ b/src/asset/sass/pages/searchPage/companyInfoPage.scss @@ -20,7 +20,7 @@ display: flex; position: relative; letter-spacing: -1px; - margin: 10% 0% 0% 13%; + margin: -3% 0% 2% 13% ; font-size: 18px; color: var(--color-primary); font-family: 'Pretendard-Bold'; @@ -89,6 +89,7 @@ } .selected-category-item { + letter-spacing : -1px; position: relative; cursor: pointer; border-radius: 50%; @@ -130,3 +131,7 @@ height: 20px; border-radius: 10px; } + +.companyInfo-css{ + margin: 5rem 0 10rem 7rem; +} \ No newline at end of file diff --git a/src/components/pages/postPage/questionDetailPage.tsx b/src/components/pages/postPage/questionDetailPage.tsx index 49262390..0be036d1 100644 --- a/src/components/pages/postPage/questionDetailPage.tsx +++ b/src/components/pages/postPage/questionDetailPage.tsx @@ -83,7 +83,7 @@ const AnswerList = styled.div` flex-direction: column; align-items: center; width: 80%; - margin: 0px 0px 10rem 7.8rem; + margin: 0px 0px 2rem 7.8rem; `; export interface AnswerProps { diff --git a/src/components/pages/searchPage/companyInfoPage.tsx b/src/components/pages/searchPage/companyInfoPage.tsx index b863f8ae..9671b132 100644 --- a/src/components/pages/searchPage/companyInfoPage.tsx +++ b/src/components/pages/searchPage/companyInfoPage.tsx @@ -50,7 +50,7 @@ const Line = styled.div` height: 5px; background-color: #fff9f4; width: 100%; - margin: 10% 0%; + margin : 5% 0% 8% 0%; stroke: 5px solid #fff9f4; `; @@ -324,7 +324,8 @@ function CompanyInfoPage() { onClick={handleQuestionClick} content1="해당 기업에 대한 질문이" content2="존재하지 않습니다" - theme="질문" + theme="질문을 남기고, 답변을 확인해 보세요!" + className='companyInfo-css' /> )} diff --git a/src/components/pages/searchPage/searchResultPage.tsx b/src/components/pages/searchPage/searchResultPage.tsx index 64c7191a..0882f107 100644 --- a/src/components/pages/searchPage/searchResultPage.tsx +++ b/src/components/pages/searchPage/searchResultPage.tsx @@ -177,7 +177,7 @@ function SearchResultPage() { const data = await response.json(); setSearchData(data.data.companyList); - // console.log('페이지 내 결과', data.data); + console.log('페이지 내 결과', data.data); } catch (error) { showErrorToast(`오류 발생: ${error}`); setSearchData([]); diff --git a/src/components/ui/myPageSelection/myAnswer.tsx b/src/components/ui/myPageSelection/myAnswer.tsx index f70393be..6a727474 100644 --- a/src/components/ui/myPageSelection/myAnswer.tsx +++ b/src/components/ui/myPageSelection/myAnswer.tsx @@ -93,9 +93,11 @@ export default function MyAnswer({ ) : ( )} diff --git a/src/components/ui/myPageSelection/myQuestion.tsx b/src/components/ui/myPageSelection/myQuestion.tsx index dfd5c31b..b4052959 100644 --- a/src/components/ui/myPageSelection/myQuestion.tsx +++ b/src/components/ui/myPageSelection/myQuestion.tsx @@ -66,6 +66,7 @@ export default function MyQuestion({ `/api/question/me?pageNo=${pageNo}&criterion=createdAt`, 'GET', ); + // console.log(data) setQuestion(data.data.questions); setTotalPages(data.data.totalPages); setQuestionCnt(data.data.totalElements); @@ -98,7 +99,9 @@ export default function MyQuestion({ onClick={goToSearch} content1="내가 남긴 질문이" content2="존재하지 않습니다" - theme="질문" + theme="질문을 남기고, 답변을 확인해보세요!" + extraMessage="기업 검색 후 " + className="my-component-css" /> )} diff --git a/src/components/ui/noContentsComponent/noContentsComponent.tsx b/src/components/ui/noContentsComponent/noContentsComponent.tsx index 714278f2..d2ee57ba 100644 --- a/src/components/ui/noContentsComponent/noContentsComponent.tsx +++ b/src/components/ui/noContentsComponent/noContentsComponent.tsx @@ -8,27 +8,35 @@ interface NoContentsComponentProps { content1: string; content2: string; theme: string; + noBtn?:boolean; + extraMessage?:string; + className?:string; } export default function NoContentsComponent({ onClick, content1, content2, theme, + noBtn, + extraMessage, + className }: NoContentsComponentProps) { return (
-
+
icon -
{content1}
-
{content2}
+
+
{content1}
+
{content2}
+
- {theme}을 남기고, 답변을 확인해 보세요! + {theme} -
+ {noBtn ?(
): (
icon - 질문 하러가기 -
+ {extraMessage}질문 하러가기 +
)}
-
- ); +
) + } From 4164b5ea0197616b56e9802cfc42c247c6d6e8da Mon Sep 17 00:00:00 2001 From: JiwonShin Date: Thu, 9 May 2024 04:38:31 +0900 Subject: [PATCH 2/2] =?UTF-8?q?(#285)feat:=20=EC=82=AD=EC=A0=9C=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=B6=94=EA=B0=80=ED=96=88=EC=8A=B5=EB=8B=88?= =?UTF-8?q?=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/postPage/questionDetailPage.tsx | 20 ++++++++++++++----- .../ui/myPageSelection/myAnswer.tsx | 2 +- .../ui/myPageSelection/myQuestion.tsx | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/components/pages/postPage/questionDetailPage.tsx b/src/components/pages/postPage/questionDetailPage.tsx index 2368a188..194c9394 100644 --- a/src/components/pages/postPage/questionDetailPage.tsx +++ b/src/components/pages/postPage/questionDetailPage.tsx @@ -216,7 +216,7 @@ function QuestionDetailPage() { content: questionContent, questionStatus: false, }; - // console.log('edit'); + console.log(questionId); try { await fetchAPI(`/api/question/${questionId}`, 'PATCH', editBody); } catch (error) { @@ -225,18 +225,28 @@ function QuestionDetailPage() { }; const handleClickDelete = async () => { - // console.log('delete'); + const deleteBody = { title: questionTitle, content: questionContent, questionStatus: false, }; + console.log(questionId); try { - await fetchAPI(`/api/question/${questionId}`, 'DELETE', deleteBody); - if (confirm('삭제하시겠습니까?')) + fetchAPI(`/api/question/${questionId}`, 'DELETE', deleteBody); + if (confirm('삭제하시겠습니까?')){ showSuccessToast('질문이 삭제되었습니다.'); + const pathSegments = window.location.pathname.split('/'); + const companyId = pathSegments[2]; + + navigate(`/company-info/${companyId}`); + + } } catch (error) { - if (error instanceof Error) showErrorToast(error.message); + if (error instanceof Error) + + showErrorToast(error.message); + console.log(error) } }; diff --git a/src/components/ui/myPageSelection/myAnswer.tsx b/src/components/ui/myPageSelection/myAnswer.tsx index 6a727474..9d460c41 100644 --- a/src/components/ui/myPageSelection/myAnswer.tsx +++ b/src/components/ui/myPageSelection/myAnswer.tsx @@ -80,7 +80,7 @@ export default function MyAnswer({ className="question-item" key={q.answerId} onClick={() => - navigate(`/company-info/${q.companyId}/${q.questionId}`) + navigate(`/company-info/${q.companyId}/${q.questionId}`,{state:{questionId: q.questionId}}) } >
diff --git a/src/components/ui/myPageSelection/myQuestion.tsx b/src/components/ui/myPageSelection/myQuestion.tsx index b4052959..f616e44e 100644 --- a/src/components/ui/myPageSelection/myQuestion.tsx +++ b/src/components/ui/myPageSelection/myQuestion.tsx @@ -85,7 +85,7 @@ export default function MyQuestion({ className="answer-item" key={q.questionId} onClick={() => - navigate(`/company-info/${q.companyId}/${q.questionId}`) + navigate(`/company-info/${q.companyId}/${q.questionId}`, {state:{questionId: q.questionId}}) } >
{q.companyName}