Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/JayJayleee/CoverFlow-FE
Browse files Browse the repository at this point in the history
…into feat/#285-ui-check-list
  • Loading branch information
JayJayleee committed May 8, 2024
2 parents 26b5d1c + b99a923 commit 683fcbd
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 30 deletions.
8 changes: 3 additions & 5 deletions src/asset/image/chat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/asset/image/view.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/asset/sass/etc/header/userInfoHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ img.loginuser {

border-radius: 10px;
border-color: #d9d9d9;
margin-left: 82%;
margin-top: -3%;
// margin-left: 82%;
// margin-top: -3%;
left: 78%;
}

.dropdown-item {
Expand Down
4 changes: 3 additions & 1 deletion src/asset/sass/etc/question/answer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
border-radius: 10px;

:nth-child(1) {
font-weight: bold;
margin: 0px 6px 0 0;
}

Expand Down Expand Up @@ -129,4 +128,7 @@
.answer-container-info {
display: flex;
justify-content: space-between;
img {
cursor: pointer;
}
}
6 changes: 3 additions & 3 deletions src/components/pages/postPage/questionDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const QuestionTitle = styled.div`
text-align: start;
padding: 1% 0 1% 1.5%;
color: #000000;
margin: 1rem 0 2% 3%;
margin: 2% 0 -1.5% 3%;
overflow: visible;
white-space: normal;
width: 500px;
Expand All @@ -59,6 +59,7 @@ const QuestionTitle = styled.div`
align-items: flex-start;
img {
cursor: pointer;
margin: 3.7% 0 0 2%;
}
`;

Expand Down Expand Up @@ -203,8 +204,7 @@ function QuestionDetailPage() {
const res = await fetchAPI('/api/member/me', 'GET');

if (res.data.nickname === questionerNickname) {
setIsShowEdit(true);
setIsShowReport(false);
setIsShowEdit((isShow) => !isShow);
} else if (res.data.nickname !== questionerNickname) {
setIsShowReport((showReport) => !showReport);
}
Expand Down
39 changes: 23 additions & 16 deletions src/components/pages/searchPage/companyInfoPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ export interface CompanInfoProps {
function CompanyInfoPage() {
const navigate = useNavigate();
const [companyData, setCompanyData] = useState<CompanInfoProps>();

const { companyId } = useParams();
const [questionsCount, setQuestionCount] = useState(0);
const [questionsCount, setQuestionsCount] = useState(0);

const [currentPage, setCurrentPage] = useState(0);
const [totalPages, setTotalPages] = useState(0);
Expand Down Expand Up @@ -138,24 +139,30 @@ function CompanyInfoPage() {
setSelectedCategories(
selectedCategories.filter((item) => item !== category),
);
} else {
setSelectedCategories([category]);
}

try {
// 같은 카테고리를 중복해서 클릭했을 때는 `${BASE_URL}/api/company/${companyId}?pageNo=0&criterion=createdAt`으로 전체 질문 조회
const { data } = await axios.get(
`${BASE_URL}/api/company/${companyId}?pageNo=0&criterion=createdAt&questionTag=${selectedCategory}`,
`${BASE_URL}/api/company/${companyId}?pageNo=0&criterion=createdAt`,
);

if (data) {
setCompanyData(data.data);
setQuestionCount(data.data.totalElements);
} else {
throw new Error('데이터가 존재하지 않습니다.');
setQuestionsCount(data.data.questionCount);
} else {
setSelectedCategories([...selectedCategories, category]);

try {
const { data } = await axios.get(
`${BASE_URL}/api/company/${companyId}?pageNo=0&criterion=createdAt&questionTag=${selectedCategory}`,
);

if (data) {
setCompanyData(data.data);
setQuestionsCount(data.data.totalElements);
} else {
throw new Error('데이터가 존재하지 않습니다.');
}
} catch (error) {
if (error instanceof Error) showErrorToast(error.message);
navigate(-1);
}
} catch (error) {
if (error instanceof Error) showErrorToast(error.message);
navigate(-1);
}
};

Expand All @@ -181,7 +188,7 @@ function CompanyInfoPage() {
if (data) {
setCompanyData(data.data);
setTotalPages(data.data.totalPages);
setQuestionCount(data.data.questionCount);
setQuestionsCount(data.data.questionCount);
} else {
throw new Error('데이터가 존재하지 않습니다.');
}
Expand Down

0 comments on commit 683fcbd

Please sign in to comment.