Skip to content

Commit

Permalink
Fix: edit reviews presignedUrls
Browse files Browse the repository at this point in the history
  • Loading branch information
JeongMin83 committed Jan 28, 2024
1 parent a5ed4a0 commit f1c2389
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 22 deletions.
7 changes: 1 addition & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {QueryClient, QueryClientProvider} from '@tanstack/react-query';
import {Suspense, useEffect} from 'react';
import {Suspense} from 'react';
import {CookiesProvider} from 'react-cookie';
import {DndProvider} from 'react-dnd';
import {HTML5Backend} from 'react-dnd-html5-backend';
Expand All @@ -24,11 +24,6 @@ function App() {
'카카오톡으로 친구와 가족들을 여행에 초대해보세요',
'요즘 인기 있는 장소를 검색해보세요',
];

useEffect(() => {
document.body.style.removeProperty('overflow');
});

return (
<Suspense
fallback={
Expand Down
1 change: 1 addition & 0 deletions src/components/Detail/BottomFixedBtn/BottomFixedBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function BottomFixedBtn({onOpen}: BottomFixedBtnProps) {
navigate('/auth/login');
},
};

const showNotLoginModal = () => {
setIsModalOpen(true);
setModalContent({...notLoginContent});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function EditReviewBottomSlide({

const checkBeforeExit = {
title: '잠깐!',
subText: '지금 나가면 작성내용이 전부 삭제돼요',
subText: '지금 나가면 수정내용이 전부 삭제돼요',
cancelText: '마저 작성할게요',
actionButton: '나갈래요',
isSmallSize: true,
Expand All @@ -66,21 +66,20 @@ function EditReviewBottomSlide({

const handlePatchMyReview = async () => {
setIsDisabled(true);

const presignedUrls = await s3Request.uploadImages(imageFileList as File[]);

if (imageFileList) {
const presignedUrls = await s3Request.uploadImages(imageFileList as File[]);

if (imageFileList) {
presignedUrls.map((url: string, i: number) => {
presignedUrls[i] = url.split('?')[0];
});
}
setImageUrls(presignedUrls);
presignedUrls.map((url: string, i: number) => {
presignedUrls[i] = url.split('?')[0];
});
}

await patchMyReview.mutateAsync({
reviewId,
rating: starCount,
content: text,
images: imageUrls,
images: imageFileList ? presignedUrls : imageUrls,
visitedAt: `${time.getFullYear()}-${('00' + (time.getMonth() + 1).toString()).slice(-2)}-01`,
});
toast('리뷰가 수정되었습니다.');
Expand All @@ -106,7 +105,7 @@ function EditReviewBottomSlide({
}}
className={styles.container__top__icon}
>
<CloseIcon width='2rem' height='2rem' />
<CloseIcon width='2rem' height='2rem' onClick={slideOnClose} />
</button>
<div className={styles.container__top__title}>리뷰 수정</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/User/MyReview/MyReview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function MyReview() {

<p className={styles.myreview__content}>{content}</p>

{images && <ReviewImageSlider images={images} />}
<div style={{padding: '0 20px'}}>{images && <ReviewImageSlider images={images} />}</div>
</li>
)),
)}
Expand Down
6 changes: 2 additions & 4 deletions src/sass/abstracts/_mixin.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//재사용 가능한 스타일 믹스인을 정의합니다.
@use "./variables";
@use "sass:map";
@use './variables';
@use 'sass:map';

@mixin typography($name) {
font-size: map-get(variables.$typography-font-size-map, $name);
Expand Down Expand Up @@ -33,8 +33,6 @@

display: flex;

padding: 0 20px;

transition: all 0.5s;
}

Expand Down

0 comments on commit f1c2389

Please sign in to comment.