Skip to content

Commit

Permalink
release: frontend v2.1 (#397)
Browse files Browse the repository at this point in the history
* fix: 회원 탈퇴 관련 오류 해결

* fix: popuup 두개 동시에 뜨는 에러 해결

---------

Co-authored-by: turtle601 <[email protected]>
  • Loading branch information
TaeyeonRoyce and turtle601 authored Aug 17, 2023
1 parent 366873f commit 3dd2e83
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
8 changes: 3 additions & 5 deletions frontend/src/components/RestaurantCard/RestaurantCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import { FONT_SIZE, truncateText } from '~/styles/common';

import type { Celeb } from '~/@types/celeb.types';
import type { Restaurant } from '~/@types/restaurant.types';
import useToggleRestaurantLike from '~/hooks/server/useToggleRestaurantLike';
import PopUpContainer from '~/components/PopUpContainer';
import { Modal, ModalContent } from '~/components/@common/Modal';
import LoginModalContent from '~/components/LoginModalContent';
import useToggleLikeNotUpdate from '~/hooks/server/useToggleLikeNotUpdate';

interface RestaurantCardProps {
restaurant: Restaurant;
Expand All @@ -22,7 +21,7 @@ interface RestaurantCardProps {

function RestaurantCard({ restaurant, celebs, size, type = 'list', setHoveredId = () => {} }: RestaurantCardProps) {
const { id, images, name, roadAddress, category, phoneNumber } = restaurant;
const { isModalOpen, closeModal, toggleRestaurantLike } = useToggleRestaurantLike(restaurant);
const { isModalOpen, closeModal, toggleRestaurantLike, isLiked } = useToggleLikeNotUpdate(restaurant);

const onMouseEnter = () => setHoveredId(restaurant.id);
const onMouseLeave = () => setHoveredId(null);
Expand All @@ -49,7 +48,7 @@ function RestaurantCard({ restaurant, celebs, size, type = 'list', setHoveredId
<StyledImageViewer>
<ImageCarousel images={images} type={type} />
<LikeButton aria-label="좋아요" type="button" onClick={toggle}>
<Love width={20} fill={restaurant.isLiked ? 'red' : '#000'} fillOpacity={0.8} aria-hidden="true" />
<Love width={20} fill={isLiked ? 'red' : '#000'} fillOpacity={0.8} aria-hidden="true" />
</LikeButton>
</StyledImageViewer>
<section>
Expand All @@ -62,7 +61,6 @@ function RestaurantCard({ restaurant, celebs, size, type = 'list', setHoveredId
<StyledProfileImageSection>
{celebs && <ProfileImageList celebs={celebs} size={size} />}
</StyledProfileImageSection>
<PopUpContainer isShowImg />
</section>
</StyledContainer>
<Modal>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/hooks/server/useDeleteUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ const useDeleteUser = () => {
}

close();
navigator('/');
window.location.href = '/';
}, []);

const onCancelDeleteUser = useCallback(() => {
navigator('/');
navigator(-1);
}, []);

return { onCancelDeleteUser, deleteUser };
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/pages/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type { RestaurantCategory } from '~/@types/restaurant.types';
import type { RestaurantListData } from '~/@types/api.types';
import useBottomSheetStatus from '~/hooks/store/useBottomSheetStatus';
import useMapState from '~/hooks/store/useMapState';
import PopUpContainer from '~/components/PopUpContainer';

function MainPage() {
const isBottomSheetOpen = useBottomSheetStatus(state => state.isOpen);
Expand Down Expand Up @@ -120,6 +121,7 @@ function MainPage() {
/>
</StyledRightSide>
</StyledLayout>
<PopUpContainer isShowImg />
<Footer />
</>
)}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/RestaurantDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function RestaurantDetail() {
}}
/>
</StyledMainLinkContainer>
<PopUpContainer />
<PopUpContainer isShowImg />
</StyledMobileBottomSheet>
)}
</>
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/pages/WishListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import styled, { css } from 'styled-components';

import Footer from '~/components/@common/Footer';
import Header from '~/components/@common/Header';
import PopUpContainer from '~/components/PopUpContainer';
import RestaurantWishList from '~/components/RestaurantWishList';
import useTokenState from '~/hooks/store/useTokenState';

Expand Down Expand Up @@ -32,6 +33,7 @@ function WishListPage() {
</StyledMobileLayout>
</div>
<Footer />
<PopUpContainer isShowImg />
</StyledWishListPageWrapper>
);
}
Expand Down

0 comments on commit 3dd2e83

Please sign in to comment.