diff --git a/src/app/service/map/_components/bottom-sheet/BottomSheetHeader.tsx b/src/app/service/map/_components/bottom-sheet/BottomSheetHeader.tsx
index d49fb649..22bd4026 100644
--- a/src/app/service/map/_components/bottom-sheet/BottomSheetHeader.tsx
+++ b/src/app/service/map/_components/bottom-sheet/BottomSheetHeader.tsx
@@ -9,6 +9,7 @@ import { Phone, Star, StarHalf, ChevronRight } from 'lucide-react';
import SquarePen from 'public/square-pen.svg';
import { BottomSheetInnerProps } from '@/types/map/BottomSheetProps';
import useReviewStore from '@/store/review/reviewStore';
+import { Rating } from '@mui/material';
function BottomSheetHeader({ data }: BottomSheetInnerProps) {
const {
@@ -72,20 +73,10 @@ function BottomSheetHeader({ data }: BottomSheetInnerProps) {
{/* 5개 빈 별공간 */}
-
-
- {Array.from({ length: 5 }, (_, index) => (
-
- ))}
-
- {/* 별 점수에 따라 넣어야함 (로직 아직안함), 별점 점수도 바꿔야함 */}
-
-
-
-
-
-
- 별점 점수
+
+
+ {score_average}
+
diff --git a/src/app/service/map/_components/bottom-sheet/BottomSheetReviewTab.tsx b/src/app/service/map/_components/bottom-sheet/BottomSheetReviewTab.tsx
index 4bcaf0d6..3f6189cc 100644
--- a/src/app/service/map/_components/bottom-sheet/BottomSheetReviewTab.tsx
+++ b/src/app/service/map/_components/bottom-sheet/BottomSheetReviewTab.tsx
@@ -1,3 +1,4 @@
+/* eslint-disable @next/next/no-img-element */
/* eslint-disable function-paren-newline */
import { useToast } from '@/app/_components/ui/use-toast';
@@ -5,6 +6,7 @@ import { BottomSheetInnerProps } from '@/types/map/BottomSheetProps';
import { ReviewListProps } from '@/types/review/ReviewProps';
import { ReviewResponseType } from '@/types/review/review';
import { ChevronDown, ChevronUp, Copy } from 'lucide-react';
+import Image from 'next/image';
import { useState } from 'react';
import { Map, MapMarker } from 'react-kakao-maps-sdk';
@@ -14,6 +16,56 @@ export default function BottomSheetReviewTab({
data: ReviewResponseType;
}) {
const { reviews, gym_name, cursor } = data; // 리뷰 데이터
+ console.log('reviews', reviews);
- return
d
;
+ return (
+
+
+ {reviews.map(review => (
+
+ {/* 이미지 */}
+ {/* ToDo : 이미지 어떻게 보여질지 라이브러리 찾아봐야함 */}
+ {review.images &&
+ review.images.map((image, index) => (
+
+ ))}
+ {/* 리뷰 작성자 */}
+
+
+
(*등급 정보없음..?)
+
+ {review.writer.nickname}
+
+
+ #(*태그 정보없음..?)
+
+
+ {/* 리뷰 내용 */}
+
{review.content}
+ {/* 리뷰에 대한 반응들 */}
+
+ {review.review_reaction_count.map(reaction => (
+ -
+ {reaction.type}: {reaction.count}
+
+ ))}
+
+
+ ))}
+
+
+ );
}
diff --git a/src/app/service/map/_components/bottom-sheet/WriteModal.tsx b/src/app/service/map/_components/bottom-sheet/WriteModal.tsx
index 1e3102e0..4a172335 100644
--- a/src/app/service/map/_components/bottom-sheet/WriteModal.tsx
+++ b/src/app/service/map/_components/bottom-sheet/WriteModal.tsx
@@ -17,6 +17,7 @@ import ReviewRegisterModal from '@/app/_components/review/review-modal/ReviewReg
import OneReview from '@/app/_components/review/review-modal/OneReview';
import { Rating } from '@mui/material';
import { ReviewRegisterType } from '@/types/review/review';
+import Image from 'next/image';
/**
* @description 지도 위에 띄위기 위해서 Modal로 구현을 합니다.
* @param position 어느 방향에서 모달이 열릴지 결정합니다.
@@ -66,6 +67,56 @@ function WriteModal({ openPosition }: ReviewProps) {
if (isLoadingMore || isEmpty) {
return ;
}
+ const [inputData, setInputData] = useState<{ value: string; count: number }>({
+ value: '',
+ count: 0,
+ });
+ const [textAreaData, setTextAreaData] = useState<{
+ value: string;
+ count: number;
+ }>({ value: '', count: 0 });
+
+ const onInputHandler = (e: React.ChangeEvent) => {
+ const value = e.target.value;
+ setInputData({
+ value,
+ count: value.replace(/[\0-\x7f]|([0-\u07ff]|(.))/g, '$&$1$2').length,
+ });
+ };
+
+ const onTextAreaHandler = (e: React.ChangeEvent) => {
+ const value = e.target.value;
+ setTextAreaData({
+ value,
+ count: value.replace(/[\0-\x7f]|([0-\u07ff]|(.))/g, '$&$1$2').length,
+ });
+ };
+ const [postImg, setPostImg] = useState([]); // 서버 저장하는 파일 상태
+ const [previewImg, setPreviewImg] = useState([]); // 미리보기 이미지를 생성하기 위한 상태 (원본이미지용량이 크기에 따로 분리)
+
+ const uploadFile = (e: React.ChangeEvent) => {
+ const fileArr = e.target.files;
+ if (fileArr) {
+ const files = Array.from(fileArr);
+ setPostImg(files);
+
+ const newPreviewImg: string[] = [];
+
+ // 한 번만 생성하고 재사용
+ const fileReader = new FileReader();
+ fileReader.onload = () => {
+ const result = fileReader.result as string;
+ setPreviewImg([...previewImg, result]);
+ };
+
+ // 파일마다 미리보기 이미지 생성
+ files.forEach(file => {
+ fileReader.readAsDataURL(file);
+ });
+ }
+ };
+
+ const handleFileUpload = (e: React.ChangeEvent) => {};
return (
<>
@@ -74,19 +125,94 @@ function WriteModal({ openPosition }: ReviewProps) {
gym_name={reviews[0].data.data.gym_name}
/>
- {/* Top */}
- {reviews[0].data.data.gym_name} 글쓰기
+
글쓰기
- {/* Middle */}
-
- {/* 리뷰남기기 */}
-
>
);
diff --git a/src/types/review/review.ts b/src/types/review/review.ts
index fbb56b2d..1cd54559 100644
--- a/src/types/review/review.ts
+++ b/src/types/review/review.ts
@@ -1,12 +1,12 @@
export interface ReactionType {
- type: 'interest' | 'like' | 'help' | 'thumb' | 'angry';
+ type: 'wantToGo' | 'helped' | 'great' | 'funny';
count: number;
}
export interface ReviewDataType {
id: number;
is_mine: boolean;
- my_reaction: 'interest' | 'like' | 'help' | 'thumb' | 'angry' | null;
+ my_reaction: 'wantToGo' | 'helped' | 'great' | 'funny' | null;
review_reaction_count: ReactionType[];
content: string;
images: string[];
@@ -16,7 +16,7 @@ export interface ReviewDataType {
writer: {
id: number;
nickname: string;
- profileImage: string;
+ profile_image: string;
};
}