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

Feat: 일정이 추가되었어요 추가 #273

Merged
merged 27 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d2f437c
Remove: theme, globalstyle 파일 삭제
seungjun222 Jan 24, 2024
32f88af
Refactor: 타입 분리
seungjun222 Jan 24, 2024
601c894
Fix:디자인 qa 적용
seungjun222 Jan 25, 2024
1caee05
Design: 디자인 QA 수정
joanShim Jan 25, 2024
4809bcc
Fix: 빌드 에러 해결
seungjun222 Jan 25, 2024
096d06f
Merge pull request #269 from FinalDoubleTen/FE-103--feat/Refactor/1st
seungjun222 Jan 25, 2024
a3f74b3
Merge branch 'dev' into FE-102--feat/Refactor
seungjun222 Jan 25, 2024
9af0c24
Merge pull request #270 from FinalDoubleTen/FE-102--feat/Refactor
seungjun222 Jan 25, 2024
bd1d50f
Fix: 여행지 검색 지역 파라미터 수정
joanShim Jan 25, 2024
ab1fc67
Chore: 안내 워딩 수정
joanShim Jan 25, 2024
eaf7e10
style: 위치 truncate 적용
NohWookJin Jan 25, 2024
7ece2eb
refactor: 값 없을시 null 반환
NohWookJin Jan 25, 2024
66abdbe
style: 워딩 qa 기반 정리
NohWookJin Jan 25, 2024
f83cd5e
style: 썸네일 모양 변경
NohWookJin Jan 25, 2024
acce36a
Fix: 오토포커스 삭제
joanShim Jan 25, 2024
10cb586
style: 기호 변경
NohWookJin Jan 25, 2024
76c008f
Merge branch 'dev' of https://github.com/FinalDoubleTen/TenTenFE into…
joanShim Jan 25, 2024
4b2425e
Design: 검색버튼 수정
joanShim Jan 25, 2024
5a85a7a
Feat: 일정이 추가되었어요 추가
LeHiHo Jan 25, 2024
487674b
style: 디자인 qa 반영
NohWookJin Jan 25, 2024
62bfb61
style: nav 신규 디자인 반영
NohWookJin Jan 25, 2024
594822a
style: 디자인 qa 적용
NohWookJin Jan 25, 2024
da052d1
style: 폰트 코드 삭제
NohWookJin Jan 25, 2024
abc82a7
style: 디자인 qa 적용
NohWookJin Jan 25, 2024
daae2af
style: 여정 디자인 qa
NohWookJin Jan 25, 2024
1a62e7c
Merge pull request #272 from WePlanPlans/QA/minorFix
LeHiHo Jan 25, 2024
aaf53e5
Merge pull request #271 from WePlanPlans/FE-83--feat/myTrip
LeHiHo Jan 25, 2024
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
15 changes: 11 additions & 4 deletions src/@types/review.types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export interface Keyword {
interface Keyword {
keywordId: number;
content: string;
type: string;
type?: string;
}

export interface CommentItemProps {
interface CommentItemProps {
commentId: number;
authorNickname: string;
authorProfileImageUrl: string;
Expand All @@ -14,7 +14,7 @@ export interface CommentItemProps {
isAuthor: boolean;
}

export interface MyReviewContent {
interface MyReviewContent {
reviewId: number;
authorNickname: string;
authorProfileImageUrl: string;
Expand All @@ -25,3 +25,10 @@ export interface MyReviewContent {
commentCount: number;
isAuthor?: boolean;
}

interface ReviewRequest {
tourItemId: number;
rating: number;
keywords: Keyword[];
content: string;
}
20 changes: 10 additions & 10 deletions src/@types/tours.types.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
export type TourKeywordInfo = {
interface TourKeywordInfo {
keywordId: number;
content: string;
type: string;
keywordCount: number;
};
}

export interface RegionTypes {
interface RegionTypes {
areaCode?: number;
subAreaCode?: number;
name: string;
}

export interface ToursCategoryItemProps extends RegionTypes {
interface ToursCategoryItemProps extends RegionTypes {
isSelected: boolean;
onSelect: (name: string) => void;
}

export interface ToursListProps {
interface ToursListProps {
selectedRegion: string;
}

export interface ToursCategoryProps extends ToursListProps {
interface ToursCategoryProps extends ToursListProps {
setSelectedRegion: (region: string) => void;
}

export interface TourType {
interface TourType {
contentTypeId?: number;
id: number;
title: string;
Expand All @@ -38,7 +38,7 @@ export interface TourType {
latitude?: string;
}

export interface LikedListType {
interface LikedListType {
tripLikedItemId: number;
tourItemId: number;
contentTypeId: number;
Expand All @@ -53,7 +53,7 @@ export interface LikedListType {
notPreferTotalCount: number;
}

export interface ReviewInfoItemProps {
interface ReviewInfoItemProps {
reviewId: number;
authorNickname: string;
authorProfileImageUrl: string;
Expand All @@ -72,5 +72,5 @@ export interface ReviewInfoItemProps {
interface Keyword {
keywordId: number;
content: string;
type: string;
type?: string;
}
12 changes: 12 additions & 0 deletions src/@types/trips.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,15 @@ interface TripMemeberInfo {
nickname: string;
profileImageUrl: string;
}

interface Participant {
memberId: number;
nickname: string;
thumbnail: string;
}

interface Participants {
tripSurveyMemberCount: number;
tripSurveySetMemberInfos: Participant[];
nonTripSurveySetMemberInfos: Participant[];
}
10 changes: 2 additions & 8 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import { ThemeProvider } from 'styled-components';
import { GlobalStyle } from '@styles/globalStyles';
import { theme } from '@styles/theme';
import { RecoilRoot } from 'recoil';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
Expand All @@ -17,11 +14,8 @@ const App = () => {
<RecoilRoot>
<BrowserRouter>
<ScrollToTop />
<ThemeProvider theme={theme}>
<GlobalStyle />
<MainRouter />
<SocketRouter />
</ThemeProvider>
<MainRouter />
<SocketRouter />
</BrowserRouter>
</RecoilRoot>
<ReactQueryDevtools initialIsOpen={false} />
Expand Down
1 change: 0 additions & 1 deletion src/api/review.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import client from './client';
import authClient from './authClient';
import { ReviewRequest } from '@recoil/review';
// 리뷰 관련 API

// 리뷰수정
Expand Down
1 change: 0 additions & 1 deletion src/components/DetailSectionBottom/DetailReviews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import ToastPopUp from '@components/common/toastpopup/ToastPopUp';
import EditDelete from '@components/common/modal/children/EditDelete';
import MyAlert from '@components/common/modal/children/MyAlert';
import { alertTypeState } from '@recoil/modal';
import { ReviewInfoItemProps } from '@/@types/tours.types';

export default function DetailReviews({
reviewData,
Expand Down
3 changes: 1 addition & 2 deletions src/components/DetailSectionBottom/ReviewItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
import { MouseEvent, useState } from 'react';
import { getEmoji } from '@utils/utils';
import { getStarFill } from '@utils/getStarFill';
import { ReviewInfoItemProps } from '@/@types/tours.types';

const Item: React.FC<ReviewInfoItemProps> = (props: ReviewInfoItemProps) => {
const {
Expand Down Expand Up @@ -185,7 +184,7 @@ const Item: React.FC<ReviewInfoItemProps> = (props: ReviewInfoItemProps) => {
.map((keyword, idx) => (
<div
key={idx}
className="rounded-md bg-gray1 px-2 py-1 text-gray6">
className="rounded-md bg-gray1 px-2 py-1 text-xs text-gray6">
{getEmoji(keyword.content)} {keyword.content}
</div>
))}
Expand Down
36 changes: 32 additions & 4 deletions src/components/DetailSectionTop/DetailAddSchedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useState, useEffect } from 'react';
import { postTripsItem } from '@api/trips';
import { useParams } from 'react-router-dom';
import { Swiper, SwiperSlide } from 'swiper/react';
import ToastPopUp from '@components/common/toastpopup/ToastPopUp';

const DetailAddSchedule = () => {
const token = localStorage.getItem('accessToken');
Expand All @@ -30,6 +31,12 @@ const DetailAddSchedule = () => {
(trip) => trip.tripStatus !== '여행완료',
);

const [toastPopUp, setToastPopUp] = useState({
isPopUp: false,
noun: '',
verb: '',
});

const handleNavigate = (url: string) => {
navigate(url);
};
Expand Down Expand Up @@ -63,6 +70,11 @@ const DetailAddSchedule = () => {
} catch (error) {
console.error('요청 실패:', error);
} finally {
setToastPopUp(() => ({
isPopUp: true,
noun: '일정',
verb: '추가',
}));
setIsProcessing(false);
}
}
Expand All @@ -79,14 +91,30 @@ const DetailAddSchedule = () => {
}
}, [isOpen]);

useEffect(() => {
if (toastPopUp.isPopUp) {
const timer = setTimeout(() => {
setToastPopUp(() => ({
isPopUp: false,
noun: '',
verb: '',
}));
}, 2000);
return () => clearTimeout(timer);
}
}, [toastPopUp]);

return (
<>
{toastPopUp.isPopUp && (
<ToastPopUp noun={toastPopUp.noun} verb={toastPopUp.verb} />
)}
{token ? (
<Dialog.Root open={isOpen} onOpenChange={setIsOpen}>
<Dialog.Trigger asChild>
<button className="flex h-[53px] w-1/2 items-center justify-center gap-2 rounded-lg border border-solid border-gray3 p-2 pr-4 ">
<CalendarIcon className="mb-[2px]" />
<span className="text-sm ">일정 추가</span>
<CalendarIcon className="mb-[2px]" color="#5E5E5E" />
<span className="text-sm text-gray5">일정 추가</span>
</button>
</Dialog.Trigger>
<Dialog.Portal>
Expand Down Expand Up @@ -244,8 +272,8 @@ const DetailAddSchedule = () => {
}
onConfirm={() => handleNavigate('/login')}>
<button className="flex h-[53px] w-1/2 items-center justify-center gap-2 rounded-lg border border-solid border-gray3 p-2 pr-4 ">
<CalendarIcon className="mb-[2px]" />
<span className="text-sm ">일정 추가</span>
<CalendarIcon className="mb-[2px]" color="#5E5E5E" />
<span className="text-sm text-gray5">일정 추가</span>
</button>
</Alert>
)}
Expand Down
4 changes: 2 additions & 2 deletions src/components/DetailSectionTop/DetailToursButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export default function DetailTourButtons({
<button
onClick={handlePostingReivew}
className="flex h-[53px] w-1/2 items-center justify-center gap-2 rounded-lg border border-solid border-gray3 p-2 pr-4">
<PenIcon className="mt-[3px]" />
<span className="text-sm ">리뷰 쓰기</span>
<PenIcon className="mt-[0.5px]" color="#5E5E5E" />
<span className="text-sm text-gray5">리뷰 쓰기</span>
</button>
</div>
</>
Expand Down
6 changes: 2 additions & 4 deletions src/components/DetailSectionTop/DetailToursInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ export default function DetailToursInfo({ infoData }: DetailToursInfoProps) {

return (
<>
<div className="column mt-1 flex aspect-[3/2] h-[11.938rem] w-full items-start overflow-hidden rounded-lg">
<div className="column flex aspect-[3/2] max-h-[176px] w-full items-start overflow-hidden rounded-lg">
<img
src={originalThumbnailUrl}
alt="tour-image"
className="h-full w-full"
/>
</div>
<div className="mt-1 flex w-full items-center justify-between py-2">
<h1 className="font-['Pretendard'] text-2xl font-bold text-black ">
{title}
</h1>
<h1 className="text-2xl font-bold text-black ">{title}</h1>
<Like liked={liked} id={id} />
</div>
</>
Expand Down
4 changes: 2 additions & 2 deletions src/components/DetailSectionTop/DetailToursMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function DetailToursMap({ mapData }: DetailToursMapProps) {

const MapStyle = {
width: '100%',
height: '180px',
height: '160px',
marginTop: '5px',
marginBottom: '15px',
};
Expand All @@ -42,7 +42,7 @@ export default function DetailToursMap({ mapData }: DetailToursMapProps) {
<div className="flex-col items-start">
<div className="mb-[10px] ml-[-2.5px] flex items-center">
<MapIcon size={24} fill="#888888" color="none" />
<p className="min-w-[310px] flex-shrink-0 flex-grow-0 overflow-hidden text-left text-sm text-[#1e1e1e]">
<p className="max-w-[325px] flex-shrink-0 flex-grow-0 overflow-hidden truncate text-left text-sm text-[#1e1e1e]">
{fullAddress}
</p>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/components/DetailSectionTop/DetailToursRating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function DetailToursRating({
<div className="flex w-full cursor-pointer items-center">
{STAR_IDX_ARR.map((item, idx) => {
return (
<span key={`${item}+${idx}`}>
<span key={`${item}+${idx}`} className="pr-[3px]">
<svg
width="16"
height="15"
Expand All @@ -67,8 +67,8 @@ export default function DetailToursRating({
</span>
);
})}
<div className="h-3 pl-1">
<p className="text-xs font-normal leading-4 text-gray4 ">
<div className="h-3 pl-[1px]">
<p className="text-[14px] font-normal leading-4 text-gray4 ">
({reviewTotalCount})
</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/MyTrip/MyTrip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const MyTrip = () => {
return (
<div className="mt-3 min-h-[100vh]">
<div className="pb-[15px]">
<h1 className="text-2xl font-bold text-black ">나의 여정</h1>
<h1 className="text-[24px] font-bold text-gray7">나의 여정</h1>
</div>
{data.length > 0 ? (
<>
Expand All @@ -42,7 +42,7 @@ const MyTrip = () => {
</>
) : (
<NoDataMessage
message1="저장된 여정 목록이 없습니다."
message1="참여하고 있는 여정이 없어요."
message2="새로운 여행을 계획해보세요!"
icon={<PenIcon size={44} fill="#EDEDED" color="#EDEDED" />}
/>
Expand Down
28 changes: 16 additions & 12 deletions src/components/MyTrip/MyTripAfterList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,22 @@ const MyTripAfterList: React.FC<MyTripIngListProps> = ({ myTripsData }) => {
new Date(a.startDate).getTime() - new Date(b.startDate).getTime(),
);

return (
<>
<div className="mb-[10px] mt-[40px]">
<h1 className="text-xl font-bold text-stone-900">지난 여행</h1>
</div>
<div className="no-scrollbar grid grid-cols-1 gap-[5px] overflow-y-scroll">
{sortedTrips.map((myTripList: MyTripType) => (
<MyTripItem key={uuidv4()} myTripList={myTripList} />
))}
</div>
</>
);
if (sortedTrips.length > 0) {
return (
<>
<div className="mb-[10px] mt-[30px]">
<h1 className="text-[18px] font-bold text-gray7">지난 여행</h1>
</div>
<div className="no-scrollbar grid grid-cols-1 gap-[5px] overflow-y-scroll">
{sortedTrips.map((myTripList: MyTripType) => (
<MyTripItem key={uuidv4()} myTripList={myTripList} />
))}
</div>
</>
);
} else {
return null;
}
};

export default MyTripAfterList;
4 changes: 2 additions & 2 deletions src/components/MyTrip/MyTripBeforeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const MyTripBeforeList: React.FC<MyTripIngListProps> = ({ myTripsData }) => {

return (
<>
<div className="mb-[10px] mt-[40px]">
<h1 className="text-xl font-bold text-stone-900">다가오는 여행</h1>
<div className="mb-[10px] mt-[30px]">
<h1 className="text-[18px] font-bold text-gray7">다가오는 여행</h1>
</div>
<div className="no-scrollbar grid grid-cols-1 gap-[5px] overflow-y-scroll">
{myTripsData.map((myTripList: MyTripType) => (
Expand Down
Loading