Skip to content

Commit

Permalink
Merge pull request #303 from JayJayleee/feat/#285-ui-check-list
Browse files Browse the repository at this point in the history
UI check list ์ˆ˜์ • ๋ฐ ์‚ญ์ œ ๋กœ์ง ์ถ”๊ฐ€
  • Loading branch information
JayJayleee committed May 8, 2024
2 parents b99a923 + 4164b5e commit 831d389
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.no-contents-wrapper {
width: 700px;
width: 550px;
height: 25rem;
display: flex;
flex-direction: column;
Expand All @@ -18,7 +18,6 @@
width: 11px;
height: 11px;
margin-right: 1rem;
overflow: scroll;
}

.no-component-plus-container {
Expand All @@ -37,6 +36,7 @@
color: #808080;
font-family: Pretendard-Medium;
letter-spacing: -1px;

}

.no-component-title {
Expand All @@ -46,3 +46,7 @@
font-family: Pretendard-Bold;
letter-spacing: -1px;
}

.my-component-css{
margin-bottom:6rem;
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
display: flex;
justify-content: center;
align-items: center;
cursor : pointer;
}

.notification-controls {
Expand Down
7 changes: 6 additions & 1 deletion src/asset/sass/pages/searchPage/companyInfoPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -89,6 +89,7 @@
}

.selected-category-item {
letter-spacing : -1px;
position: relative;
cursor: pointer;
border-radius: 50%;
Expand Down Expand Up @@ -130,3 +131,7 @@
height: 20px;
border-radius: 10px;
}

.companyInfo-css{
margin: 5rem 0 10rem 7rem;
}
22 changes: 16 additions & 6 deletions src/components/pages/postPage/questionDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,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 {
Expand Down Expand Up @@ -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) {
Expand All @@ -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)
}
};

Expand Down
5 changes: 3 additions & 2 deletions src/components/pages/searchPage/companyInfoPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
`;

Expand Down Expand Up @@ -331,7 +331,8 @@ function CompanyInfoPage() {
onClick={handleQuestionClick}
content1="ํ•ด๋‹น ๊ธฐ์—…์— ๋Œ€ํ•œ ์งˆ๋ฌธ์ด"
content2="์กด์žฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค"
theme="์งˆ๋ฌธ"
theme="์งˆ๋ฌธ์„ ๋‚จ๊ธฐ๊ณ , ๋‹ต๋ณ€์„ ํ™•์ธํ•ด ๋ณด์„ธ์š”!"
className='companyInfo-css'
/>
)}

Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/searchPage/searchResultPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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([]);
Expand Down
8 changes: 5 additions & 3 deletions src/components/ui/myPageSelection/myAnswer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}})
}
>
<div className="question-text">
Expand All @@ -93,9 +93,11 @@ export default function MyAnswer({
) : (
<NoContentsComponent
onClick={goToSearch}
content1="๋‚ด๊ฐ€ ๋‚จ๊ธด ๋‹ต๋ณ€"
content1="๋‚ด๊ฐ€ ๋‚จ๊ธด ๋‹ต๋ณ€์ด"
content2="์กด์žฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค"
theme="๋‹ต๋ณ€"
theme="๋‹ต๋ณ€์„ ๋‚จ๊ธฐ๊ณ  ํ™•์ธํ•ด๋ณด์„ธ์š”."
noBtn={true}
className="my-component-css"
/>
)}

Expand Down
7 changes: 5 additions & 2 deletions src/components/ui/myPageSelection/myQuestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -84,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}})
}
>
<div className="answer-item-title">{q.companyName}</div>
Expand All @@ -98,7 +99,9 @@ export default function MyQuestion({
onClick={goToSearch}
content1="๋‚ด๊ฐ€ ๋‚จ๊ธด ์งˆ๋ฌธ์ด"
content2="์กด์žฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค"
theme="์งˆ๋ฌธ"
theme="์งˆ๋ฌธ์„ ๋‚จ๊ธฐ๊ณ , ๋‹ต๋ณ€์„ ํ™•์ธํ•ด๋ณด์„ธ์š”!"
extraMessage="๊ธฐ์—… ๊ฒ€์ƒ‰ ํ›„ "
className="my-component-css"
/>
)}

Expand Down
26 changes: 17 additions & 9 deletions src/components/ui/noContentsComponent/noContentsComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div>
<div className="no-contents-wrapper">
<div className={`no-contents-wrapper ${className}`}>
<img src={Icon} alt="icon" />
<div className="no-component-title">{content1}</div>
<div className="no-component-title">{content2}</div>
<div>
<div className="no-component-title">{content1}</div>
<div className="no-component-title">{content2}</div>
</div>
<span className="no-component-diclaimer">
{theme}์„ ๋‚จ๊ธฐ๊ณ , ๋‹ต๋ณ€์„ ํ™•์ธํ•ด ๋ณด์„ธ์š”!
{theme}
</span>
<div className="no-component-plus-container" onClick={onClick}>
{noBtn ?(<div style={{height:"3rem"}}></div>): (<div className="no-component-plus-container" onClick={onClick}>
<img className="no-component-plus" src={plus} alt="icon" />
<span className="ask-question">์งˆ๋ฌธ ํ•˜๋Ÿฌ๊ฐ€๊ธฐ</span>
</div>
<span className="ask-question">{extraMessage}์งˆ๋ฌธ ํ•˜๋Ÿฌ๊ฐ€๊ธฐ</span>
</div>)}
</div>
</div>
);
</div>)

}

0 comments on commit 831d389

Please sign in to comment.