Skip to content

Commit

Permalink
Feat: 디바운싱 재적용, 모바일환경에서 커서공유 블락
Browse files Browse the repository at this point in the history
  • Loading branch information
LeHiHo committed Jan 26, 2024
2 parents 3fb36fd + 80f7e8b commit d4dc03f
Show file tree
Hide file tree
Showing 96 changed files with 724 additions and 692 deletions.
37 changes: 25 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0 maximum-scale=1" />
<title>위플플 | 여정 공유 플랫폼</title>
</head>
<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-1285JF2LMZ"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0 maximum-scale=1" />
<title>위플플 | 여정 공유 플랫폼</title>
</head>
gtag('config', 'G-1285JF2LMZ');
</script>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>

</html>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
1 change: 1 addition & 0 deletions src/@types/detail.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
interface tourDetail {
id: number;
contentTypeId: number;
title: string;
liked: boolean;
fullAddress: string;
Expand Down
33 changes: 28 additions & 5 deletions src/@types/review.types.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
interface ReviewRequest {
tourItemId: number;
interface Keyword {
keywordId: number;
content: string;
type?: string;
}

interface CommentItemProps {
commentId: number;
authorNickname: string;
authorProfileImageUrl: string;
createdTime: string;
content: string;
onClick?: () => void;
isAuthor: boolean;
}

interface MyReviewContent {
reviewId: number;
authorNickname: string;
authorProfileImageUrl: string;
rating: number;
keywords: Keyword[];
createdTime: string;
content: string;
keywords: Keyword[];
commentCount: number;
isAuthor?: boolean;
}

interface Keyword {
keywordId: number;
interface ReviewRequest {
tourItemId: number;
rating: number;
keywords: Keyword[];
content: string;
}
38 changes: 30 additions & 8 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 @@ -52,3 +52,25 @@ export interface LikedListType {
preferTotalCount: number;
notPreferTotalCount: number;
}

interface ReviewInfoItemProps {
reviewId: number;
authorNickname: string;
authorProfileImageUrl: string;
rating: number;
createdTime: string;
content: string;
keywords: Keyword[]; // keywordId, content, type
commentCount: number;
onClick?: () => void;
tourItemId?: number;
contentTypeId?: number;
canTextOverflow: boolean;
isAuthor?: boolean;
}

interface Keyword {
keywordId: number;
content: string;
type?: string;
}
22 changes: 22 additions & 0 deletions src/@types/trips.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,25 @@ interface AuthorityType {
tripId: string;
};
}
interface TripSurveySetMemberInfo {
memberId: number;
nickname: string;
thumbnail: string;
}

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';

// 리뷰 관련 API

// 리뷰수정
Expand Down
1 change: 1 addition & 0 deletions src/api/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export const pubUpdateTransportation = (
destination: `/pub/trips/${tripId}/updateTransportation`,
body: JSON.stringify(pubUpdateTransportation),
});
console.log('펍실행');
};

// 여행 아이템 방문 날짜 변경 이벤트 발생시
Expand Down
52 changes: 27 additions & 25 deletions src/components/DetailSectionBottom/DetailReviews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import EditDelete from '@components/common/modal/children/EditDelete';
import MyAlert from '@components/common/modal/children/MyAlert';
import { alertTypeState } from '@recoil/modal';

interface reviewProps {
reviewData: any;
}

export default function DetailReviews({ reviewData }: reviewProps) {
export default function DetailReviews({
reviewData,
}: {
reviewData: tourDetail;
}) {
const [reviewDataLength, setReviewDataLength] = useState<number>(0);
const { title, contentTypeId } = reviewData;
const params = useParams();
Expand Down Expand Up @@ -73,7 +73,7 @@ export default function DetailReviews({ reviewData }: reviewProps) {
return <div>데이터를 불러오는 중 오류가 발생했습니다.</div>;
}

const handleReviewClick = (item: any) => {
const handleReviewClick = (item: ReviewInfoItemProps) => {
const reviewId = item.reviewId;
navigate(`/reviewComment/${reviewId}`, { state: { item, tourItemId } });
};
Expand Down Expand Up @@ -155,24 +155,26 @@ export default function DetailReviews({ reviewData }: reviewProps) {
{
return (
<React.Fragment key={index}>
{group?.data.data.reviewInfos.content.map((item: any) => (
<ReviewItem
key={item.reviewId}
reviewId={item.reviewId}
authorNickname={item.authorNickname}
authorProfileImageUrl={item.authorProfileImageUrl}
rating={item.rating}
createdTime={item.createdTime}
content={item.content}
keywords={item.keywords}
commentCount={item.commentCount}
onClick={() => handleReviewClick(item)}
tourItemId={tourItemId}
contentTypeId={contentTypeId}
canTextOverflow={true}
isAuthor={item.isAuthor}
/>
))}
{group?.data.data.reviewInfos.content.map(
(item: ReviewInfoItemProps) => (
<ReviewItem
key={item.reviewId}
reviewId={item.reviewId}
authorNickname={item.authorNickname}
authorProfileImageUrl={item.authorProfileImageUrl}
rating={item.rating}
createdTime={item.createdTime}
content={item.content}
keywords={item.keywords}
commentCount={item.commentCount}
onClick={() => handleReviewClick(item)}
tourItemId={tourItemId}
contentTypeId={contentTypeId}
canTextOverflow={true}
isAuthor={item.isAuthor}
/>
),
)}
</React.Fragment>
);
}
Expand All @@ -187,7 +189,7 @@ export default function DetailReviews({ reviewData }: reviewProps) {
{modalChildren === 'MyAlert' && alertType === 'LoginReview' && (
<MyAlert
title="로그인"
content="리뷰 쓰기 시 로그인이 필요해요. 로그인하시겠어요?"
content="리뷰를 쓰려면 로그인이 필요해요. 로그인하러 가볼까요?"
/>
)}
</Modal>
Expand Down
26 changes: 2 additions & 24 deletions src/components/DetailSectionBottom/ReviewItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,7 @@ import { MouseEvent, useState } from 'react';
import { getEmoji } from '@utils/utils';
import { getStarFill } from '@utils/getStarFill';

interface Keyword {
keywordId: number;
content: string;
type: string;
}

interface ItemProps {
reviewId: number;
authorNickname: string;
authorProfileImageUrl: string;
rating: number;
createdTime: any;
content: string;
keywords: Keyword[]; // keywordId, content, type
commentCount: number;
onClick?: () => void;
tourItemId?: number;
contentTypeId?: number;
canTextOverflow: boolean;
isAuthor?: boolean;
}

const Item: React.FC<ItemProps> = (props: ItemProps) => {
const Item: React.FC<ReviewInfoItemProps> = (props: ReviewInfoItemProps) => {
const {
reviewId,
authorNickname,
Expand Down Expand Up @@ -206,7 +184,7 @@ const Item: React.FC<ItemProps> = (props: ItemProps) => {
.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
Loading

0 comments on commit d4dc03f

Please sign in to comment.