Skip to content

Commit

Permalink
fix: userData -> myData
Browse files Browse the repository at this point in the history
  • Loading branch information
he2e2 committed Dec 9, 2024
1 parent 064644e commit 38d016a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 23 deletions.
25 changes: 4 additions & 21 deletions src/widgets/UserContents/UserContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ContentsTab } from './ContentsTab';
import { useUserTab } from './hook/useUserTab';

import type { ColorCountDTO } from '@/features';
import { ColorMap, useUserArchiveColors, useUserArchiveList } from '@/features';
import { ColorMap, useMyArchiveList, useUserArchiveColors } from '@/features';
//import type { GatheringItemDto } from '@/features/gathering/model/gathering.dto';
import { Loader } from '@/shared/ui';
import { PieChart } from '@/shared/ui/Chart/PieChart';
Expand All @@ -15,10 +15,10 @@ interface ArchiveContentProps {
}

const ArchiveContent = ({ userId }: ArchiveContentProps) => {
const { items: archives, isFetchingNextPage, isPending, ref } = useUserArchiveList(userId);
const { data: archives, isPending } = useMyArchiveList();
const { data: colorData, isPending: isColorPending } = useUserArchiveColors(userId);

if (!colorData?.data || isColorPending || isPending) {
if (!colorData?.data || isColorPending || isPending || !archives?.data) {
return <Loader />;
}

Expand All @@ -38,28 +38,11 @@ const ArchiveContent = ({ userId }: ArchiveContentProps) => {
<PieChart data={convertToChartData(colorData.data)} />
</div>
</div>
<ArchiveGrid archives={archives} isMine />
<div ref={ref}>{isFetchingNextPage && <Loader />}</div>
<ArchiveGrid archives={archives?.data?.archives} />
</div>
);
};

// const dummyGatherings: GatheringItemDto<'프로젝트'>[] = Array.from({ length: 9 }, (_, i) => ({
// gatheringId: i.toString(),
// title: `Sample Gathering ${i + 1}`,
// userId: `user_${i}`,
// username: '홍길동',
// sort: '프로젝트',
// subject: '개발', // ProjectSubjectType만 허용
// tags: ['React', 'TypeScript', 'Next.js'],
// deadLine: '2024-11-28',
// position: ['개발자', '디자이너'], // 여러 포지션 가능
// contactType: '온라인',
// period: '3개월',
// personnel: '3',
// }));
// const GatheringContent = () => <GatheringGrid items={dummyGatherings} />;

const ContentComponents = {
gathering: ArchiveContent,
archive: ArchiveContent,
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/WriteArchive/WriteStep.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
display: flex;
align-items: center;
justify-content: center;
width: 1.3rem;
height: 1.3rem;
width: 1rem;
height: 1rem;
background-color: $primary-color;
border-radius: 50%;

Expand Down

0 comments on commit 38d016a

Please sign in to comment.