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

[FIX] QA 4차반영 #232

Merged
merged 2 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/components/card/templeStayCard/TempleStayCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface TempleStayCardProps {
liked: boolean;
layout: 'vertical' | 'horizontal';
onToggleWishlist: (templestayId: number, liked: boolean) => void;
onClick?: () => void;
onClick?: (templestayId: number) => void;
onRequireLogin?: () => void;
}

Expand Down Expand Up @@ -53,7 +53,7 @@ const TempleStayCard = ({
return (
<article
className={isHorizontal ? styles.horizontalContainer : styles.verticalContainer}
onClick={onClick}
onClick={() => onClick?.(templestayId)}
role="presentation">
{imgUrl ? (
<section className={isHorizontal ? styles.horizontalImgSection : styles.verticalImgSection}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ interface WishCardListProps {
}[];
layout: 'vertical' | 'horizontal';
onToggleWishlist: (templestayId: number, liked: boolean) => void;
onClick?: (templestayId: number) => void;
}
const WishCardList = ({ data, layout = 'vertical', onToggleWishlist }: WishCardListProps) => {
const WishCardList = ({
data,
layout = 'vertical',
onToggleWishlist,
onClick,
}: WishCardListProps) => {
return (
<section className={container}>
{data.map((temple) => (
Expand All @@ -33,6 +39,7 @@ const WishCardList = ({ data, layout = 'vertical', onToggleWishlist }: WishCardL
liked={temple.liked}
layout={layout}
onToggleWishlist={onToggleWishlist}
onClick={onClick}
/>
))}
</section>
Expand Down
3 changes: 0 additions & 3 deletions src/components/schedule/scheduleCard.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,4 @@ export const description = style({
...theme.FONTS.b8M15,
color: theme.COLORS.black,
width: '20.5rem',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
});
7 changes: 7 additions & 0 deletions src/pages/wishList/WishListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import Pagination from '@components/common/pagination/Pagination';
import ExceptLayout from '@components/except/exceptLayout/ExceptLayout';
import { useQueryClient } from '@tanstack/react-query';
import { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';

import container from './wishListPage.css';

const WishListPage = () => {
const [currentPage, setCurrentPage] = useState(1);
const userId = Number(localStorage.getItem('userId'));
const queryClient = useQueryClient();
const navigate = useNavigate();

const { data, isLoading, isError } = useWishlistQuery(currentPage, userId);
const addWishlistMutation = useAddWishlist();
Expand Down Expand Up @@ -62,6 +64,10 @@ const WishListPage = () => {
}
};

const handleNavigate = (templestayId: number) => {
navigate(`/detail/${templestayId}`);
};

if (isLoading) {
return <ExceptLayout type="loading" />;
}
Expand All @@ -81,6 +87,7 @@ const WishListPage = () => {
data={wishlist}
layout="vertical"
onToggleWishlist={handleToggleWishlist}
onClick={(templestayId: number) => handleNavigate(templestayId)}
/>
</div>
<Pagination
Expand Down
Loading