Skip to content

Commit

Permalink
Merge pull request #166 from ssu-student-union/feat/#148_jongse_qa_3
Browse files Browse the repository at this point in the history
Feat/#148 jongse qa 3
  • Loading branch information
jongse7 authored Sep 26, 2024
2 parents 404bbb9 + 8ddc0ea commit 0f6fd50
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/PostCard/PostCardBasicMissing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface PostCardProps {
title?: string;
subtitle?: string;
date?: string;
badgeType?: 'Emergency' | 'New' | 'Default';
badgeType?: string;
cardType: 'Basic' | 'Missing';
size?: Size;
profileImg?: string | null;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/main/containers/CampusMapSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const CampusMapSection = () => {
<h1 className="text-[2rem] font-bold xs:text-[1.25rem]">캠퍼스맵</h1>
<ArrowUpRight
onClick={() => {
navigate(`/lost-article?category=state`);
navigate(`/campus`);
window.scrollTo(0, 0);
}}
className="ml-2 cursor-pointer"
Expand Down
9 changes: 8 additions & 1 deletion src/pages/notice/component/NoticeContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,14 @@ export function NoticeContent({ initPosts, isLoading }: NoticeContentProps) {

function RenderCard({ post, size }: RenderCardProps) {
const formattedDate = post.date ? formatYYYYMMDD(post.date) : '';
const status = post.status === '긴급공지' ? 'Emergency' : 'Default';
let status;
if (status === '긴급공지') {
status = 'Emergency';
} else if (status === '새로운') {
status = 'New';
} else {
status = 'Default';
}
const thumbnail = post.thumbNail || undefined;

return (
Expand Down
6 changes: 5 additions & 1 deletion src/pages/notice/hooks/useNoticeBoard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ import {
} from '../const/data';
import { useGetBoardPostSearch } from '@/hooks/useGetBoardPostSearch';
import { NoticeResponse } from '../types';
import { useRecoilValue } from 'recoil';
import { SearchState } from '@/recoil/atoms/atom';

export function useNoticeBoard(boardCode: string) {
const { itemsPerPage } = useResponseBoard();
const { currentPage, handlePageChange } = useCurrentPage();
const { urlCategory, urlSubCategory } = useNoticeCategory();

const searchQuery = useRecoilValue(SearchState);

const subcategories =
urlCategory === 'college'
? Object.values(collegeSubCategoryMap).filter(Boolean)
Expand All @@ -36,9 +40,9 @@ export function useNoticeBoard(boardCode: string) {
page: currentPage - 1,
groupCode: selectedCategory,
memberCode: selectedSubCategory,
q: searchQuery,
});

// const posts: Post[] = data?.data?.postListResDto || [];
const totalPages: number = data?.data?.pageInfo?.totalPages ?? 0;

return {
Expand Down

0 comments on commit 0f6fd50

Please sign in to comment.