diff --git a/src/pages/GatheringDetailPage/GatheringDetailPage.tsx b/src/pages/GatheringDetailPage/GatheringDetailPage.tsx
index 4e260fb..0b3e26a 100644
--- a/src/pages/GatheringDetailPage/GatheringDetailPage.tsx
+++ b/src/pages/GatheringDetailPage/GatheringDetailPage.tsx
@@ -6,6 +6,7 @@ import { MarkdownPreview } from '@/features';
import { GatheringDetailUserInfo } from '@/features/gathering';
import { useGatheringDetail, useGatheringLike } from '@/features/gathering/lib/hooks';
import { Loader, TripleDot } from '@/shared/ui';
+import { customToast, errorAlert } from '@/shared/ui';
import { LikeBtn } from '@/shared/ui/LikeBtn/LikeBtn';
import { GatheringDetailBtnCon, GatheringDetailHeader, GatheringDetailGrid } from '@/widgets';
@@ -15,11 +16,11 @@ export const GatheringDetailPage = () => {
const { mutate: toggleLike, isPending } = useGatheringLike({
gatheringId: gatheringId!,
- onSuccess: response => {
- console.log('좋아요 성공:', response);
+ onSuccess: () => {
+ customToast({ text: '이 게시물에 좋아요를 눌렀습니다.', timer: 3000, icon: 'success' });
},
- onError: error => {
- console.error('좋아요 실패:', error);
+ onError: () => {
+ errorAlert({ title: '좋아요 실패', text: '좋아요를 누르는데 실패했습니다.' });
},
});
if (isLoading) {
@@ -45,13 +46,13 @@ export const GatheringDetailPage = () => {
}
const gatheringDetail = data?.data;
- console.log('gatheringDetail:', gatheringDetail);
return (
{chatOptions.map(option => (
diff --git a/src/widgets/GatheringDetail/GatheringDetailBtnCon.tsx b/src/widgets/GatheringDetail/GatheringDetailBtnCon.tsx
index d97b8d2..62ee10e 100644
--- a/src/widgets/GatheringDetail/GatheringDetailBtnCon.tsx
+++ b/src/widgets/GatheringDetail/GatheringDetailBtnCon.tsx
@@ -54,8 +54,14 @@ export const GatheringDetailBtnCon = ({ gatheringId, userId }: GatheringDetailBt
navigate(path);
};
- const handleEdit = () => {
- handleNavigate(`/gathering/edit/${gatheringId}`);
+ const handleEdit = async () => {
+ const result = await customConfirm({
+ title: '게더링 수정',
+ text: '게더링을 수정하시겠습니까?',
+ confirmButtonText: '수정',
+ cancelButtonText: '취소',
+ });
+ if (result.isConfirmed && gatheringId) handleNavigate(`/gathering/edit/${gatheringId}`);
};
const handleDelete = async () => {
@@ -66,7 +72,7 @@ export const GatheringDetailBtnCon = ({ gatheringId, userId }: GatheringDetailBt
cancelButtonText: '취소',
});
- if (result && gatheringId) {
+ if (result.isConfirmed && gatheringId) {
deleteGathering(gatheringId);
}
};
@@ -83,7 +89,7 @@ export const GatheringDetailBtnCon = ({ gatheringId, userId }: GatheringDetailBt
cancelButtonText: '취소',
});
- if (result && gatheringId) {
+ if (result.isConfirmed && gatheringId) {
completeGathering(gatheringId);
}
};
diff --git a/src/widgets/GatheringDetail/GatheringDetailGrid.module.scss b/src/widgets/GatheringDetail/GatheringDetailGrid.module.scss
index 8a50b14..86b4074 100644
--- a/src/widgets/GatheringDetail/GatheringDetailGrid.module.scss
+++ b/src/widgets/GatheringDetail/GatheringDetailGrid.module.scss
@@ -2,6 +2,7 @@
display: grid;
grid-template-columns: repeat(2, 3fr);
width: 100%;
+ padding: 0 1.5rem;
margin-top: 3rem;
@media (width <= 768px) {
diff --git a/src/widgets/GatheringDetail/GatheringDetailGrid.tsx b/src/widgets/GatheringDetail/GatheringDetailGrid.tsx
index 753f876..19c47c3 100644
--- a/src/widgets/GatheringDetail/GatheringDetailGrid.tsx
+++ b/src/widgets/GatheringDetail/GatheringDetailGrid.tsx
@@ -13,6 +13,7 @@ interface GatheringDetailGridProps {
deadLine: string;
positions: string[];
gatheringTag: string[];
+ contactUrl: string;
}
export const GatheringDetailGrid = ({
@@ -26,6 +27,7 @@ export const GatheringDetailGrid = ({
deadLine,
positions,
gatheringTag,
+ contactUrl,
}: GatheringDetailGridProps) => {
return (
@@ -39,6 +41,7 @@ export const GatheringDetailGrid = ({
+
);
};
diff --git a/src/widgets/GatheringDetail/GatheringDetailHeader.tsx b/src/widgets/GatheringDetail/GatheringDetailHeader.tsx
index 1dce288..7c8f9a5 100644
--- a/src/widgets/GatheringDetail/GatheringDetailHeader.tsx
+++ b/src/widgets/GatheringDetail/GatheringDetailHeader.tsx
@@ -5,14 +5,15 @@ import { Breadcrumb } from '@/shared/ui';
interface GatheringDetailHeaderProps {
title?: string;
+ username: string;
}
-export const GatheringDetailHeader = ({ title }: GatheringDetailHeaderProps) => {
+export const GatheringDetailHeader = ({ title, username }: GatheringDetailHeaderProps) => {
return (
);
};
diff --git a/src/widgets/GatheringGrid/GatheringGrid.tsx b/src/widgets/GatheringGrid/GatheringGrid.tsx
index 2387e4c..ffd047e 100644
--- a/src/widgets/GatheringGrid/GatheringGrid.tsx
+++ b/src/widgets/GatheringGrid/GatheringGrid.tsx
@@ -15,11 +15,13 @@ export const GatheringGrid = ({ items }: GatheringGridProps) => {
))}
diff --git a/src/widgets/Layout/ui/Footer/Footer.tsx b/src/widgets/Layout/ui/Footer/Footer.tsx
index aeed41c..fd3b47b 100644
--- a/src/widgets/Layout/ui/Footer/Footer.tsx
+++ b/src/widgets/Layout/ui/Footer/Footer.tsx
@@ -3,7 +3,7 @@ import styles from './Footer.module.scss';
export const Footer = () => {
return (
);
diff --git a/src/widgets/Layout/ui/Header/Header.tsx b/src/widgets/Layout/ui/Header/Header.tsx
index c6a477a..a6705a5 100644
--- a/src/widgets/Layout/ui/Header/Header.tsx
+++ b/src/widgets/Layout/ui/Header/Header.tsx
@@ -143,7 +143,7 @@ export const Header = () => {
-
Palettee
+
Palette
{isMobile ? (
<>
diff --git a/src/widgets/LikeTab/LikeTab.module.scss b/src/widgets/LikeTab/LikeTab.module.scss
index 4e34a25..d8e88ba 100644
--- a/src/widgets/LikeTab/LikeTab.module.scss
+++ b/src/widgets/LikeTab/LikeTab.module.scss
@@ -44,3 +44,24 @@
}
}
}
+
+.portfolioGrid,
+.gatheringGrid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
+ gap: 2rem;
+ width: 100%;
+
+ @media (width <= 768px) {
+ gap: 1.5rem;
+ }
+}
+
+.loading {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 100%;
+ height: 100px;
+ margin-top: 1rem;
+}
diff --git a/src/widgets/LikeTab/LikeTab.tsx b/src/widgets/LikeTab/LikeTab.tsx
index 9953183..8cd03c0 100644
--- a/src/widgets/LikeTab/LikeTab.tsx
+++ b/src/widgets/LikeTab/LikeTab.tsx
@@ -1,26 +1,15 @@
import { ArchiveGrid } from '../ArchiveGrid';
-import { GatheringGrid } from '../GatheringGrid';
import styles from './LikeTab.module.scss';
-import type { GatheringItem } from '@/features';
-import { useLikeArchiveList } from '@/features';
+import {
+ GatheringCard,
+ PortfolioCard,
+ useGatheringLikeList,
+ useInfinitePortfolioLikeList,
+ useLikeArchiveList,
+} from '@/features';
import { Loader, TripleDot } from '@/shared/ui';
-const dummyGatherings: GatheringItem[] = Array.from({ length: 9 }, (_, i) => ({
- gatheringId: i,
- userId: i,
- contactType: '온라인',
- sort: '스터디',
- subject: '개발',
- period: '1개월',
- personnel: '1',
- position: ['개발자'],
- title: `Sample Gathering`,
- deadLine: '2022-12-31',
- username: '홍길동',
- tags: ['tag1', 'tag2'],
-}));
-
export const LikeTab = ({
activeTab,
setActiveTab,
@@ -30,16 +19,46 @@ export const LikeTab = ({
}) => {
const tabs = ['포트폴리오', '아카이브', '게더링'];
+ // 아카이브 좋아요 목록
const {
items: likeArchives,
isPending: isArchiveLoading,
- isFetchingNextPage,
- ref,
+ isFetchingNextPage: isArchiveFetchingNext,
+ ref: archiveRef,
} = useLikeArchiveList();
+ // 포트폴리오 좋아요 목록
+ const {
+ portfolios,
+ isLoading: isPortfolioLoading,
+ isFetchingNextPage: isPortfolioFetchingNext,
+ // ref: portfolioRef,
+ } = useInfinitePortfolioLikeList();
+
+ // 게더링 좋아요 목록
+ const {
+ gatherings,
+ isLoading: isGatheringLoading,
+ isFetchingNextPage: isGatheringFetchingNext,
+ hasNextPage: hasGatheringNextPage,
+ fetchNextPage: fetchGatheringNextPage,
+ } = useGatheringLikeList();
+
const renderingLikeTap = (activeTab: string) => {
if (activeTab === '포트폴리오') {
- // return
;
+ if (!portfolios || isPortfolioLoading) {
+ return
;
+ }
+ return (
+ <>
+
+ {portfolios.map(portfolio => (
+
+ ))}
+
+
{isPortfolioFetchingNext && }
+ >
+ );
} else if (activeTab === '아카이브') {
if (!likeArchives || isArchiveLoading) {
return
;
@@ -47,13 +66,29 @@ export const LikeTab = ({
return (
<>
-
- {isFetchingNextPage &&
}
+
+ {isArchiveFetchingNext && }
>
);
} else if (activeTab === '게더링') {
- return
;
+ if (!gatherings || isGatheringLoading) {
+ return
;
+ }
+ return (
+ <>
+
+ {gatherings.map(gathering => (
+
+ ))}
+
+ {hasGatheringNextPage && (
+
fetchGatheringNextPage()}>
+ {isGatheringFetchingNext && }
+
+ )}
+ >
+ );
}
};
diff --git a/src/widgets/MainGatheringGrid/MainGatheringGrid.module.scss b/src/widgets/MainGatheringGrid/MainGatheringGrid.module.scss
index e69de29..febb459 100644
--- a/src/widgets/MainGatheringGrid/MainGatheringGrid.module.scss
+++ b/src/widgets/MainGatheringGrid/MainGatheringGrid.module.scss
@@ -0,0 +1,45 @@
+.grid {
+ display: grid;
+ grid-template-rows: 1fr;
+ grid-template-columns: repeat(4, 1fr);
+ gap: 1rem;
+ width: 100%;
+ overflow: hidden;
+
+ & > :nth-child(5) {
+ display: none;
+ }
+
+ @media (width <= 1000px) {
+ grid-template-columns: repeat(3, 1fr);
+ gap: 1rem;
+
+ & > :nth-child(5),
+ & > :nth-child(4) {
+ display: none;
+ }
+ }
+
+ @media (width <= 768px) {
+ grid-template-columns: repeat(2, 1fr);
+ gap: 1rem;
+
+ & > :nth-child(5),
+ & > :nth-child(4),
+ & > :nth-child(3) {
+ display: none;
+ }
+ }
+
+ @media (width <= 580px) {
+ grid-template-columns: repeat(1, 1fr);
+ gap: 1rem;
+
+ & > :nth-child(5),
+ & > :nth-child(4),
+ & > :nth-child(3),
+ & > :nth-child(2) {
+ display: none;
+ }
+ }
+}
diff --git a/src/widgets/MainGatheringGrid/MainGatheringGrid.tsx b/src/widgets/MainGatheringGrid/MainGatheringGrid.tsx
index e69de29..55e2425 100644
--- a/src/widgets/MainGatheringGrid/MainGatheringGrid.tsx
+++ b/src/widgets/MainGatheringGrid/MainGatheringGrid.tsx
@@ -0,0 +1,36 @@
+import styles from './MainGatheringGrid.module.scss';
+
+import { GatheringCard, useMainGathering } from '@/features';
+import { Loader, TripleDot } from '@/shared/ui';
+
+export const MainGatheringGrid = () => {
+ const { items, isLoading, isError } = useMainGathering();
+
+ if (isLoading) return
;
+ if (isError) {
+ return (
+
+
+ 에러가 발생했습니다.
+
+ );
+ }
+
+ // 데이터가 없는 경우
+ if (!items || items.length === 0) {
+ return (
+
+
+ 검색된 내용이 없습니다.
+
+ );
+ }
+
+ return (
+
+ {items.map(gathering => (
+
+ ))}
+
+ );
+};
diff --git a/src/widgets/MainGridItem/MainGridItem.tsx b/src/widgets/MainGridItem/MainGridItem.tsx
index 574a756..a152014 100644
--- a/src/widgets/MainGridItem/MainGridItem.tsx
+++ b/src/widgets/MainGridItem/MainGridItem.tsx
@@ -6,7 +6,7 @@ import { useNavigate } from 'react-router-dom';
import styles from './MainGridItem.module.scss';
import { ArchiveCard, usePopularArchive } from '@/features';
-import { MainPortfolioGrid } from '@/widgets';
+import { MainPortfolioGrid, MainGatheringGrid } from '@/widgets';
export const MainGridItem = ({ type }: { type: string }) => {
const navigate = useNavigate();
@@ -68,7 +68,7 @@ export const MainGridItem = ({ type }: { type: string }) => {
현재 모집 중인 게더링
-
+
);
diff --git a/src/widgets/MainPortfolioGrid/MainPortfolioGrid.tsx b/src/widgets/MainPortfolioGrid/MainPortfolioGrid.tsx
index 4def1b8..4e92e18 100644
--- a/src/widgets/MainPortfolioGrid/MainPortfolioGrid.tsx
+++ b/src/widgets/MainPortfolioGrid/MainPortfolioGrid.tsx
@@ -5,7 +5,7 @@ import { Loader, TripleDot } from '@/shared/ui';
export const MainPortfolioGrid = () => {
const { data, isLoading, isError } = useMainPortfolioList();
- console.log(data);
+ // console.log(data);
if (isLoading) return
;
if (isError)
diff --git a/src/widgets/RegisterUser/ProfileStep.tsx b/src/widgets/RegisterUser/ProfileStep.tsx
index 33d60e8..63bcd9a 100644
--- a/src/widgets/RegisterUser/ProfileStep.tsx
+++ b/src/widgets/RegisterUser/ProfileStep.tsx
@@ -58,7 +58,7 @@ export const ProfileStep = ({ setStage }: ProfileStepProps) => {
socials: data.url.map(link => link.value),
s3StoredImageUrls: [],
};
- console.log(postUserData);
+ // console.log(postUserData);
createUser(
{
data: postUserData,
diff --git a/src/widgets/SettingUser/SetProfile.tsx b/src/widgets/SettingUser/SetProfile.tsx
index 7da13ac..2c6d153 100644
--- a/src/widgets/SettingUser/SetProfile.tsx
+++ b/src/widgets/SettingUser/SetProfile.tsx
@@ -72,7 +72,7 @@ export const SetProfile = ({ userData }: SetProfileProps) => {
s3StoredImageUrls: [],
};
- console.log(putUserData);
+ // console.log(putUserData);
editUser(
{
diff --git a/src/widgets/index.ts b/src/widgets/index.ts
index e235c74..d4175c4 100644
--- a/src/widgets/index.ts
+++ b/src/widgets/index.ts
@@ -10,6 +10,7 @@ export * from './LikeTab/LikeTab';
export * from './LoginModal/ui/LoginModal';
export * from './MainBanner/MainBanner';
export * from './MainContents/MainContents';
+export * from './MainGatheringGrid/MainGatheringGrid';
export * from './MainPortfolioGrid/MainPortfolioGrid';
export * from './MenuModal/MenuModal';
export * from './NoticeContainer/NoticeContainer';
@@ -19,3 +20,4 @@ export * from './UserContents/UserContents';
export * from './WriteArchive';
export * from './WriteGathering/WriteGatheringDetail';
export * from './WriteGathering/WriteGatheringOpts';
+