Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: 게시글 목록 상대경로 수정 및 title 데이터 매핑 #274

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions src/components/listPage/PostList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import {
PRICE_TO_POST_TYPES,
SORT_OPTIONS,
} from '@/constants';
import { splitTitleByDelimiter } from '@/utils';
import { getPostPageSize } from '@/utils/getPageSize';

import EmptyCard from '../../layout/empty/EmptyCard';

import { BaseButton } from '@/components/commons/buttons/BaseButton';
import { CommonCard } from '@/components/commons/cards/CommonCard';
import Dropdown from '@/components/commons/Dropdown';
import { SearchBar } from '@/components/commons/inputs/SearchBar';
import Pagination from '@/components/commons/Pagination';
import Tab from '@/components/commons/Tab';
import EmptyCard from '@/components/layout/empty/EmptyCard';
import { useDeviceType } from '@/hooks/useDeviceType';
import useProcessedDataList from '@/hooks/useProcessedDataList';

Expand Down Expand Up @@ -105,19 +105,23 @@ const PostList = ({ isLoggedIn, activitiesData: initialDataList }: PostListProps
</div>
{totalCount !== 0 ? (
<ul className={cx('post-list-container-card-list')}>
{pagedDataList.map((data) => (
<li className={cx('card')} key={data.id}>
<CommonCard
path={`/${game}/${data.id}`}
postType={PRICE_TO_POST_TYPES[data.price]}
title={data.title}
address={data.address}
rating={data.rating}
reviewCount={data.reviewCount}
createdAt={data.createdAt}
/>
</li>
))}
{pagedDataList.map((data) => {
const { title } = splitTitleByDelimiter(data.title);

return (
<li className={cx('card')} key={data.id}>
<CommonCard
path={`/${game}/${data.id}`}
postType={PRICE_TO_POST_TYPES[data.price]}
title={title}
address={data.address}
rating={data.rating}
reviewCount={data.reviewCount}
createdAt={data.createdAt}
/>
</li>
);
})}
</ul>
) : (
<EmptyCard text='No Post' />
Expand Down