diff --git a/src/components/Auth/AuthInput/AuthInputBox/AuthInputItem/AuthInput.tsx b/src/components/Auth/AuthInput/AuthInputBox/AuthInputItem/AuthInput.tsx index 6a6ea0f9..94943892 100644 --- a/src/components/Auth/AuthInput/AuthInputBox/AuthInputItem/AuthInput.tsx +++ b/src/components/Auth/AuthInput/AuthInputBox/AuthInputItem/AuthInput.tsx @@ -33,7 +33,7 @@ const AuthInput = ({ return (
-
diff --git a/src/components/DetailSectionBottom/ReviewItem.tsx b/src/components/DetailSectionBottom/ReviewItem.tsx index c11e040e..2ff1c349 100644 --- a/src/components/DetailSectionBottom/ReviewItem.tsx +++ b/src/components/DetailSectionBottom/ReviewItem.tsx @@ -151,51 +151,41 @@ const Item: React.FC = (props: ReviewInfoItemProps) => {
{!showMoreKeywords && - keywords.slice(0, 2).map((keyword, idx) => ( + keywords.slice(0, 1).map((keyword, idx) => (
{getEmoji(keyword.content)} {keyword.content}
))} - {keywords.length > 2 && !showMoreKeywords && ( + {keywords.length > 1 && !showMoreKeywords && (
{ handleClickPlusButton(e); }}> - +{keywords.length - 2} + +{keywords.length - 1}
)}
+
- {showMoreKeywords && - Array.from({ length: Math.ceil(keywords.length / 2) }).map( - (_, lineIdx) => ( + {showMoreKeywords && ( +
+ {keywords.map((keyword, idx) => (
- {keywords - .slice(lineIdx * 2, lineIdx * 2 + 2) - .map((keyword, idx) => ( -
- {getEmoji(keyword.content)} {keyword.content} -
- ))} + key={idx} + className="rounded-md bg-gray1 px-2 py-1 text-xs text-gray6"> + {getEmoji(keyword.content)} {keyword.content}
- ), - )} + ))} +
+ )}
-
+
-
{commentCount}
+
{commentCount}
diff --git a/src/components/MyTrip/MyTrip.tsx b/src/components/MyTrip/MyTrip.tsx index c80f12fc..1062e245 100644 --- a/src/components/MyTrip/MyTrip.tsx +++ b/src/components/MyTrip/MyTrip.tsx @@ -30,9 +30,9 @@ const MyTrip = () => { const { ingTrips, beforeTrips, afterTrips } = classifyTrips(data); return ( -
-
-

나의 여정

+
+
+

나의 여정

{data.length > 0 ? ( <> diff --git a/src/components/MyTrip/MyTripAfterList.tsx b/src/components/MyTrip/MyTripAfterList.tsx index c5d65cb4..c7ddd74c 100644 --- a/src/components/MyTrip/MyTripAfterList.tsx +++ b/src/components/MyTrip/MyTripAfterList.tsx @@ -19,16 +19,16 @@ const MyTripAfterList: React.FC = ({ myTripsData }) => { if (sortedTrips.length > 0) { return ( - <> -
+
+

지난 여행

-
+
{sortedTrips.map((myTripList: MyTripType) => ( ))}
- +
); } else { return null; diff --git a/src/components/MyTrip/MyTripBeforeList.tsx b/src/components/MyTrip/MyTripBeforeList.tsx index 88dc770f..c6792597 100644 --- a/src/components/MyTrip/MyTripBeforeList.tsx +++ b/src/components/MyTrip/MyTripBeforeList.tsx @@ -12,18 +12,22 @@ const MyTripBeforeList: React.FC = ({ myTripsData }) => { return
데이터를 불러오는 중 오류가 발생했습니다.
; } - return ( - <> -
-

다가오는 여행

+ if (myTripsData.length > 0) { + return ( +
+
+

다가오는 여행

+
+
+ {myTripsData.map((myTripList: MyTripType) => ( + + ))} +
-
- {myTripsData.map((myTripList: MyTripType) => ( - - ))} -
- - ); + ); + } else { + return null; + } }; export default MyTripBeforeList; diff --git a/src/components/MyTrip/MyTripIngItem.tsx b/src/components/MyTrip/MyTripIngItem.tsx index 3ff6392c..328a80d0 100644 --- a/src/components/MyTrip/MyTripIngItem.tsx +++ b/src/components/MyTrip/MyTripIngItem.tsx @@ -24,7 +24,7 @@ const MyTripIngItem: React.FC = ({ myTripList }) => { alt="여행지 이미지" />
-
+
{tripStatus} diff --git a/src/components/MyTrip/MyTripIngList.tsx b/src/components/MyTrip/MyTripIngList.tsx index 758a4f71..01cf3210 100644 --- a/src/components/MyTrip/MyTripIngList.tsx +++ b/src/components/MyTrip/MyTripIngList.tsx @@ -14,7 +14,7 @@ const MyTripIngList: React.FC = ({ myTripsData }) => { return ( <> -
+
{myTripsData.map((myTripList: MyTripType) => ( ))} diff --git a/src/components/MyTrip/MyTripItem.tsx b/src/components/MyTrip/MyTripItem.tsx index b5878161..4fe80cce 100644 --- a/src/components/MyTrip/MyTripItem.tsx +++ b/src/components/MyTrip/MyTripItem.tsx @@ -54,7 +54,7 @@ const MyTripItem: React.FC = ({ myTripList }) => {
navigate(`/trip/${tripId}`)}>
diff --git a/src/components/Mypage/UserInfoForm.tsx b/src/components/Mypage/UserInfoForm.tsx index 6126a244..8cedc7e4 100644 --- a/src/components/Mypage/UserInfoForm.tsx +++ b/src/components/Mypage/UserInfoForm.tsx @@ -4,11 +4,12 @@ import { Link, useNavigate } from 'react-router-dom'; import { useRecoilValue } from 'recoil'; import { UserInfoState } from '@recoil/Auth.atom'; import { useEffect } from 'react'; -import SubmitBtn from '@components/common/button/SubmitBtn'; import UserInfoImg from '@components/Auth/SignupInfo/UserInfoImg'; import AuthNicknameInputBox from '@components/Auth/AuthInput/AuthInputBox/AuthNicknameInputBox'; import AuthDropDown from '@components/Auth/SignupInfo/AuthDropDown/AuthDropDown'; import { ageArr, genderArr } from '@utils/authSelectOptions'; +import { BackBox } from '@components/common'; +import DeleteMemberButton from './DeleteMemberButton'; const UserInfoForm = () => { const { @@ -53,52 +54,66 @@ const UserInfoForm = () => { }; return ( -
-
-
- -
-
-
- {userInfo?.email} + <> + { + navigate('/mypage'); + }} + showSave + isSaveValid={isValid} + saveHandler={handleSubmit(onInfoSubmit)}> + 회원정보 수정 + +
+ +
+
+ +
+
+
+ {userInfo?.email} +
+ + 비밀번호 변경 + +
+ +
+ + +
- - 비밀번호 변경 - -
- -
- - -
+ +
-
- 완료 -
- + ); }; diff --git a/src/components/Review/CommentItem.tsx b/src/components/Review/CommentItem.tsx index c74ff1c5..929621b9 100644 --- a/src/components/Review/CommentItem.tsx +++ b/src/components/Review/CommentItem.tsx @@ -44,7 +44,7 @@ const CommentItem: React.FC = (props: CommentItemProps) => { }; return ( -
+
{!( diff --git a/src/components/Review/ReviewComments.tsx b/src/components/Review/ReviewComments.tsx index 05dd0244..fbf4858b 100644 --- a/src/components/Review/ReviewComments.tsx +++ b/src/components/Review/ReviewComments.tsx @@ -85,7 +85,7 @@ export default function ReviewComments() { 댓글 {commentDataLength}
-
+
{commentDataLength == 0 && (
diff --git a/src/components/Review/ReviewKeyword.tsx b/src/components/Review/ReviewKeyword.tsx index d6c24780..c33d7323 100644 --- a/src/components/Review/ReviewKeyword.tsx +++ b/src/components/Review/ReviewKeyword.tsx @@ -45,38 +45,29 @@ export default function ReviewKeyword() { } }; - // 5x2 형태로 배치하기 위해 행(row)과 열(column)을 계산 - // const rows = 5; - const columns = 2; - return ( <>
어떤 점이 좋았나요?
-
- {reviewKeywords?.data?.data?.keywords?.map( - (keyword: Keyword, index: number) => { - const row = Math.floor(index / columns) + 1; - const col = (index % columns) + 1; - - const isSelected = selectedKeywords.some( - (selectedKeyword) => - selectedKeyword.keywordId === keyword.keywordId, - ); +
+ {reviewKeywords?.data?.data?.keywords?.map((keyword: Keyword) => { + const isSelected = selectedKeywords.some( + (selectedKeyword) => + selectedKeyword.keywordId === keyword.keywordId, + ); - return ( - - ); - }, - )} + return ( + + ); + })}
); diff --git a/src/components/Trip/LikedToursList.tsx b/src/components/Trip/LikedToursList.tsx index 9fa49f59..fcca4483 100644 --- a/src/components/Trip/LikedToursList.tsx +++ b/src/components/Trip/LikedToursList.tsx @@ -68,7 +68,7 @@ export const LikedToursList = () => { }, []); return ( -
+
{data?.pages[0].data.content.length > 0 ? ( diff --git a/src/components/Trip/LikedToursLists/LikedToursListBox.tsx b/src/components/Trip/LikedToursLists/LikedToursListBox.tsx index 39ef3aae..45bba12d 100644 --- a/src/components/Trip/LikedToursLists/LikedToursListBox.tsx +++ b/src/components/Trip/LikedToursLists/LikedToursListBox.tsx @@ -48,7 +48,7 @@ const LikedToursListBox: React.FC = ({ {/* */}
}> -
+
{isLoading ? Array.from({ length: 10 }, (_, index) => ( diff --git a/src/components/Trip/LikedToursLists/LikedToursListCategory.tsx b/src/components/Trip/LikedToursLists/LikedToursListCategory.tsx index 8e78be04..1ffe97d4 100644 --- a/src/components/Trip/LikedToursLists/LikedToursListCategory.tsx +++ b/src/components/Trip/LikedToursLists/LikedToursListCategory.tsx @@ -27,7 +27,7 @@ const LikedToursListCategory: React.FC = ({ }; return ( -
+
{categories.map((category) => { return ( + className={`body4 mr-[5px] flex items-center justify-center whitespace-nowrap rounded-[30px] border border-solid bg-[#28D8FF] px-[16px] py-[7px] leading-normal ${buttonStyle}`}> {category.name} ); diff --git a/src/components/Trip/LikedToursLists/LikedToursListItem.tsx b/src/components/Trip/LikedToursLists/LikedToursListItem.tsx index f72641fa..f01607b4 100644 --- a/src/components/Trip/LikedToursLists/LikedToursListItem.tsx +++ b/src/components/Trip/LikedToursLists/LikedToursListItem.tsx @@ -83,7 +83,7 @@ const LikedToursListItem: React.FC = ({ />
-
+

{title} @@ -105,7 +105,7 @@ const LikedToursListItem: React.FC = ({

-
+

{tourAddress ? tourAddress : '주소를 제공하지 않고 있어요'}

diff --git a/src/components/Wish/Wish.tsx b/src/components/Wish/Wish.tsx index 560a700a..296c4a77 100644 --- a/src/components/Wish/Wish.tsx +++ b/src/components/Wish/Wish.tsx @@ -44,9 +44,11 @@ const Wish = () => { } return ( -
-
-

나의 관심 목록

+
+
+

+ 나의 관심 목록 +

diff --git a/src/components/Wish/WishCategoryItem.tsx b/src/components/Wish/WishCategoryItem.tsx index 8704adff..4fcf3516 100644 --- a/src/components/Wish/WishCategoryItem.tsx +++ b/src/components/Wish/WishCategoryItem.tsx @@ -27,7 +27,7 @@ const WishCategoryItem: React.FC = ({ return ( ); diff --git a/src/components/Wish/WishItem.tsx b/src/components/Wish/WishItem.tsx index 75928caa..cc7a4edd 100644 --- a/src/components/Wish/WishItem.tsx +++ b/src/components/Wish/WishItem.tsx @@ -32,7 +32,7 @@ const WishItem: React.FC = ({ wishList }) => { return (
navigate(`/detail/${id}`)}>
@@ -46,12 +46,12 @@ const WishItem: React.FC = ({ wishList }) => {
-
-
-

+

+
+

{title}

-
+

{isMetroIncluded && tourAddress ? (tourAddress.match(/(.*?[시군구])/)?.[0] || '') + @@ -63,25 +63,25 @@ const WishItem: React.FC = ({ wishList }) => {

-
+
-
- +
+
-
- +
+ {(Math.ceil(ratingAverage * 100) / 100).toFixed(1)} - + ({reviewCount ? reviewCount.toLocaleString() : reviewCount})
-
-
- +
+
+
- + {likedCount ? likedCount.toLocaleString() : likedCount}
diff --git a/src/components/Wish/WishList.tsx b/src/components/Wish/WishList.tsx index c4fbb68d..3889d820 100644 --- a/src/components/Wish/WishList.tsx +++ b/src/components/Wish/WishList.tsx @@ -45,7 +45,7 @@ const WishList: React.FC = ({
}> -
+
{isLoading ? Array.from({ length: 10 }, (_, index) => ( diff --git a/src/components/common/BackBox/BackBox.tsx b/src/components/common/BackBox/BackBox.tsx index 0d29c96f..6e51e9c9 100644 --- a/src/components/common/BackBox/BackBox.tsx +++ b/src/components/common/BackBox/BackBox.tsx @@ -8,6 +8,7 @@ interface Props { showSkip?: boolean; skipHandler?: VoidFunction; showSave?: boolean; + isSaveValid?: boolean; saveHandler?: VoidFunction; showShare?: boolean; shareHandler?: VoidFunction; @@ -20,6 +21,7 @@ const BackBox = ({ showSkip, skipHandler, showSave, + isSaveValid, saveHandler, showShare, shareHandler, @@ -51,7 +53,8 @@ const BackBox = ({ )} {showSave && ( diff --git a/src/components/common/icons/Icons.tsx b/src/components/common/icons/Icons.tsx index ec00f17e..5676e760 100644 --- a/src/components/common/icons/Icons.tsx +++ b/src/components/common/icons/Icons.tsx @@ -305,36 +305,19 @@ export const CheckIcon = ({ ); }; -interface LeftIconProps { - width?: number; - height?: number; - fill?: string; - onClick?: VoidFunction; - cursor?: string; -} - -export const LeftIcon = ({ - width = 8, - height = 15, - fill = '#1E1E1E', - onClick, - cursor = 'pointer', -}: LeftIconProps) => { +export const LeftIcon = () => { return ( + xmlns="http://www.w3.org/2000/svg" + width="9" + height="16" + viewBox="0 0 9 16" + fill="none"> ); @@ -1806,3 +1789,21 @@ export const GrayCalendarIcon: React.FC = ({}) => { ); }; + +export const AuthDropDownIcon = () => { + return ( + + + + ); +}; diff --git a/src/components/common/nav/InputComment.tsx b/src/components/common/nav/InputComment.tsx index 00a343dc..ebaad8f5 100644 --- a/src/components/common/nav/InputComment.tsx +++ b/src/components/common/nav/InputComment.tsx @@ -106,12 +106,11 @@ export const InputComment: React.FC = () => { }; return ( -
-
+
+
{ - const navigate = useNavigate(); - return ( - <> - { - navigate('/mypage'); - }} - // showSave - // saveHandler={() => {}} - > - 회원정보 수정 - -
- - -
- - ); + return ; }; export default EditUserInfo; diff --git a/src/pages/mypage/editUserSurvey.page.tsx b/src/pages/mypage/editUserSurvey.page.tsx index adf0f324..12124c49 100644 --- a/src/pages/mypage/editUserSurvey.page.tsx +++ b/src/pages/mypage/editUserSurvey.page.tsx @@ -1,21 +1,47 @@ +import { putMemberSurvey } from '@api/member'; import AuthSurvey from '@components/Auth/AuthSurvey/AuthSurvey'; import { BackBox } from '@components/common'; +import { SubmitHandler, useForm } from 'react-hook-form'; import { useNavigate } from 'react-router-dom'; const EditUserSurvey = () => { const navigate = useNavigate(); + const { + register, + handleSubmit, + setValue, + formState: { isValid }, + } = useForm(); + + const onSaveSubmit: SubmitHandler = async (data) => { + try { + const res = await putMemberSurvey({ survey: data }); + if (res.data.status === 200) { + navigate(-1); + } + } catch (err) { + console.error(err); + alert('오류가 발생했습니다. 다시 시도해주세요'); + } + }; + + console.log(isValid); + return ( <> { navigate(-1); - }}> + }} + showSave + isSaveValid={isValid} + saveHandler={handleSubmit(onSaveSubmit)}> 나의 여행 취향 설정
- +
); diff --git a/src/pages/signup/signup.page.tsx b/src/pages/signup/signup.page.tsx index def45d2d..7ee023b0 100644 --- a/src/pages/signup/signup.page.tsx +++ b/src/pages/signup/signup.page.tsx @@ -9,10 +9,12 @@ import { import { BackBox } from '@components/common'; import SubmitBtn from '@components/common/button/SubmitBtn'; import { CheckboxIcon } from '@components/common/icons/Icons'; +import { UserInfoState } from '@recoil/Auth.atom'; import { setItem } from '@utils/localStorageFun'; import { useEffect } from 'react'; import { SubmitHandler, useForm } from 'react-hook-form'; import { useNavigate } from 'react-router-dom'; +import { useSetRecoilState } from 'recoil'; const Signup = () => { const { @@ -39,6 +41,8 @@ const Signup = () => { } }, [password, trigger]); + const setUserInfo = useSetRecoilState(UserInfoState); + const onSignupSubmit: SubmitHandler = async (data) => { const { email, password } = data; @@ -48,6 +52,14 @@ const Signup = () => { password, }); if (res.status === 200) { + setUserInfo({ + nickname: res.data.data.nickName!, + email: res.data.data.email!, + profileImageUrl: null, + ageType: null, + genderType: null, + survey: null, + }); setItem('accessToken', res.data.data.tokenInfo.accessToken); navigate('/signup/success'); } diff --git a/src/pages/signup/signupSuccess.page.tsx b/src/pages/signup/signupSuccess.page.tsx index 82eeb663..9a8fa527 100644 --- a/src/pages/signup/signupSuccess.page.tsx +++ b/src/pages/signup/signupSuccess.page.tsx @@ -5,7 +5,7 @@ import { useNavigate } from 'react-router-dom'; const SignupSuccess = () => { const navigate = useNavigate(); return ( -
+
diff --git a/src/pages/signup/signupSurvey.page.tsx b/src/pages/signup/signupSurvey.page.tsx index a00fe2e2..f3a73cf7 100644 --- a/src/pages/signup/signupSurvey.page.tsx +++ b/src/pages/signup/signupSurvey.page.tsx @@ -3,9 +3,32 @@ import { BackBox } from '@components/common'; import AuthSurvey from '@components/Auth/AuthSurvey/AuthSurvey'; import { useNavigate } from 'react-router-dom'; import { ProgressBarIcon } from '@components/common/icons/Icons'; +import { SubmitHandler, useForm } from 'react-hook-form'; +import SubmitBtn from '@components/common/button/SubmitBtn'; +import { putMemberSurvey } from '@api/member'; const SignupSurvey = () => { const navigate = useNavigate(); + + const { + register, + handleSubmit, + setValue, + formState: { isDirty, isValid }, + } = useForm(); + + const onSaveSubmit: SubmitHandler = async (data) => { + try { + const res = await putMemberSurvey({ survey: data }); + if (res.data.status === 200) { + navigate('/signup/info'); + } + } catch (err) { + console.error(err); + alert('오류가 발생했습니다. 다시 시도해주세요'); + } + }; + return (
{ title={'어떤 여행을 좋아하세요?'} subTitle="여행 취향을 골라주세요." /> - + + + 완료 +
); }; diff --git a/src/utils/authSelectOptions.ts b/src/utils/authSelectOptions.ts index d16d0a59..576bbc79 100644 --- a/src/utils/authSelectOptions.ts +++ b/src/utils/authSelectOptions.ts @@ -1,12 +1,10 @@ export const genderArr: SelectOption[] = [ - { id: '', value: '성별을 선택해주세요.' }, { id: 'FEMALE', value: '여' }, { id: 'MALE', value: '남' }, { id: 'NON_BINARY', value: '기타' }, ]; export const ageArr: SelectOption[] = [ - { id: '', value: '연령대를 설정해주세요.' }, { id: 'TEENAGER', value: '10대' }, { id: 'TWENTIES', value: '20대' }, { id: 'THIRTIES', value: '30대' },