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: 상세페이지에서 주변다른식당으로 이동시 뒤로가기 기능이 동작하지 않는 오류 개선 #689

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
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { css, styled } from 'styled-components';
import { MouseEventHandler, memo, useCallback } from 'react';
import { useNavigate } from 'react-router-dom';
import Love from '~/assets/icons/love.svg';
import { FONT_SIZE, truncateText } from '~/styles/common';
import Star from '~/assets/icons/star.svg';
Expand Down Expand Up @@ -37,9 +36,12 @@ function MiniRestaurantCard({
}: MiniRestaurantCardProps) {
const { id, images, name, roadAddress, category, rating, distance } = restaurant;
const { toggleRestaurantLike, isLiked } = useToggleLikeNotUpdate(restaurant);
const navigate = useNavigate();

const register = useOnClickBlock({ callback: () => navigate(`/restaurants/${id}?celebId=${celebs[0].id}`) });
const register = useOnClickBlock({
callback: () => {
window.location.href = `/restaurants/${id}?celebId=${celebs[0].id}`;
},
});

const handleCardMouseEnter = useCallback(() => {
setHoveredId(restaurant.id);
Expand Down
Loading