Skip to content

Commit

Permalink
(Team-Coverflow#285)style: 문의 페이지 스타일 추가 수정했습니다.
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJayleee committed May 6, 2024
1 parent c357464 commit 31aadc3
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 13 deletions.
21 changes: 14 additions & 7 deletions src/components/pages/postPage/questionWritePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,26 @@ function QuestionWritePage() {
companyId: Number(companyId),
reward: Number(reward),
};

if (body.title.length > 100) {
showErrorToast('제목은 100자 이하로 작성해주세요.');
return;
}
if (body.content.length > 1000) {
showErrorToast('내용은 1000자 이하로 작성해주세요.');
return;
}

const isValid = Object.values(body).every(
(value) => value !== null && value !== '',
);

if (!isValid) {
throw new Error('모든 필드를 채워주세요.');
} else {
await fetchAPI('/api/question', 'POST', body);

showSuccessToast('질문이 등록되었습니다');

navigate(`/company-info/${companyId}`);
}

await fetchAPI('/api/question', 'POST', body);
showSuccessToast('질문이 등록되었습니다');
navigate(`/company-info/${companyId}`);
} catch (error) {
// console.log(error);
showErrorToast(`에러 발생 ${error}`);
Expand Down
10 changes: 6 additions & 4 deletions src/components/ui/contactSlider/contactList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@
}

.inquiry-content-question {
width: 19rem;
min-height: 1rem;
text-indent: 1rem;
width: 100%;
line-height: 2.6rem;
padding-bottom: 1.5rem;
font-size: small;
font-size: 1.6rem;
margin: 3% 0% 0% 0%;
letter-spacing: -1px;
color: #474646;
}

.inquiry-button-container {
Expand Down
4 changes: 4 additions & 0 deletions src/components/ui/contactSlider/contactSlider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ export default function ContactSlider() {

const submitContact = async () => {
try {
if (contact.title.length > 20) {
showErrorToast('제목을 20자 이하로 작성해주세요.');
return;
}
const res = await fetchAPI('/api/inquiry', 'POST', contact);
if (res.statusCode === 'CREATED') {
setCurrentSection('contactList');
Expand Down
5 changes: 3 additions & 2 deletions src/components/ui/myPageSelection/myComponent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0% 0% 3% 0%;

width: 30rem;
}

.answer-item-content {
Expand All @@ -60,7 +61,7 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0% 0% 1% 0%;
width: 30rem;
}

.quetion-tag {
Expand Down

0 comments on commit 31aadc3

Please sign in to comment.