- {open ? (
-
- {data?.data.pickedTask.task}
-
- ) : (
-
- )}
+
+
+ 워크스페이스 목표를
+ 모두 달성했어요!
-
- 카드를 눌러 테스크를 확인하세요
-
-
-
-
미당첨된 테스크
-
- {data?.data.tasks.map((item: any) => {
- return (
-
- {item.task}
-
- );
- })}
+
+
+
+
+
+
+ 최종순위를 확인 후
+
+ 테스크를 수행해보세요!
+
+
+
+
+
+
+ 팀별 순위
+
+
+
- {open &&
}
);
}
diff --git a/src/app/(afterLogin)/workspace-complete/_components/OneLastRank.tsx b/src/app/(afterLogin)/workspace-complete/_components/OneLastRank.tsx
new file mode 100644
index 0000000..ca76aaa
--- /dev/null
+++ b/src/app/(afterLogin)/workspace-complete/_components/OneLastRank.tsx
@@ -0,0 +1,36 @@
+import Image from 'next/image';
+
+interface OneLastRankProps {
+ rankPrize: any;
+ name: string;
+ contributeScore: number;
+ rank: number;
+ height: string;
+}
+
+export default function OneLastRank({
+ rankPrize,
+ name,
+ contributeScore,
+ rank,
+ height,
+}: OneLastRankProps) {
+ return (
+
+
+
+
+ {name}
+
+ 총 {contributeScore}점
+
+
+
+
+
+ );
+}
diff --git a/src/app/(afterLogin)/workspace-complete/_components/TaskContent.tsx b/src/app/(afterLogin)/workspace-complete/_components/TaskContent.tsx
new file mode 100644
index 0000000..293cbcf
--- /dev/null
+++ b/src/app/(afterLogin)/workspace-complete/_components/TaskContent.tsx
@@ -0,0 +1,23 @@
+import Image from 'next/image';
+
+import completeTask from '@/../public/images/completeTask.png';
+
+interface TaskContentProps {
+ task: string;
+}
+
+export default function TaskContent({ task }: TaskContentProps) {
+ return (
+
+ );
+}
diff --git a/src/app/(afterLogin)/workspace-complete/_components/TaskRankMenbers.tsx b/src/app/(afterLogin)/workspace-complete/_components/TaskRankMenbers.tsx
new file mode 100644
index 0000000..9a7f690
--- /dev/null
+++ b/src/app/(afterLogin)/workspace-complete/_components/TaskRankMenbers.tsx
@@ -0,0 +1,39 @@
+import Image from 'next/image';
+
+import taskRank from '@/../public/svgs/workspace/taskRank.svg';
+
+interface workerProps {
+ name: string;
+ rank: number;
+ contributeScore: number;
+}
+
+interface TaskRankMenbersProps {
+ workers: workerProps[];
+}
+
+export default function TaskRankMenbers({ workers }: TaskRankMenbersProps) {
+ return (
+
+ {workers.map((worker) => (
+
+
+
+
+ {worker.rank}
+
+
+
+ {worker.name}
+
+ {worker.contributeScore} P
+
+
+
+ ))}
+
+ );
+}
diff --git a/src/app/(afterLogin)/workspace-list/_components/AllGroupTabs.tsx b/src/app/(afterLogin)/workspace-list/_components/AllGroupTabs.tsx
index 6fdeada..d31522e 100644
--- a/src/app/(afterLogin)/workspace-list/_components/AllGroupTabs.tsx
+++ b/src/app/(afterLogin)/workspace-list/_components/AllGroupTabs.tsx
@@ -15,12 +15,7 @@ import nextArrow from '@/../public/svgs/nextArrow.svg';
import Image from 'next/image';
import { useEffect, useState } from 'react';
-import {
- allWorkspaces,
- alreadyIn,
- joinWorkspace,
- matchPassword,
-} from '@/api/workspace';
+import { allWorkspaces, alreadyIn, joinWorkspace } from '@/api/workspace';
import { useInfiniteQuery } from '@tanstack/react-query';
import { workspace } from '@/constants/queryKey';
@@ -34,14 +29,12 @@ export default function AllGroupTabs() {
const [search, setSearch] = useState('');
const [tabValue, setTabValue] = useState(workspaceList.complete);
const [password, setPassword] = useState('');
- const [task, setTask] = useState('');
const [error, setError] = useState('');
const router = useRouter();
const [isFirstDialogOpen, setIsFirstDialogOpen] = useState(false);
- const [isSecondDialogOpen, setIsSecondDialogOpen] = useState(false);
const [currentWorkspaceId, setCurrentWorkspaceId] = useState(0);
@@ -60,43 +53,22 @@ export default function AllGroupTabs() {
},
initialPageParam: 0,
getNextPageParam: (lastPage, allPages) => {
- // console.log('lastPage:', lastPage);
return lastPage?.nextPage || undefined;
},
});
- const nextDialog = async (e: any) => {
- e.preventDefault();
- try {
- const res = await matchPassword({
- workspaceId: currentWorkspaceId,
- password,
- });
- console.log(res);
-
- if (res?.data.sameness === true) {
- setIsFirstDialogOpen(false);
- setIsSecondDialogOpen(true);
- } else {
- setError('잘못된 비밀번호입니다.');
- }
- } catch (error) {
- console.error(error);
- }
- };
-
const onSubmit = async (e: any) => {
e.preventDefault();
try {
//워크스페이스 아이디 받아서 전해주기
const res = await joinWorkspace({
password,
- task,
workspaceId: currentWorkspaceId,
});
- console.log(res);
if (res.status === 200) {
router.push(`/workspace/${currentWorkspaceId}`);
+ } else {
+ setError('잘못된 비밀번호입니다.');
}
} catch (error) {
if (error instanceof AxiosError) {
@@ -116,7 +88,6 @@ export default function AllGroupTabs() {
const handleAlreadyIn = async (workspaceId: number) => {
const res = await alreadyIn(workspaceId);
- console.log(res);
if (res.data.isWorker === true) {
setIsFirstDialogOpen(false);
@@ -130,21 +101,16 @@ export default function AllGroupTabs() {
};
const { ref, inView } = useInView({
- //아래 ref div가 보이고 나서 몇픽셀정도가 호출될건가? -> 보이자마자 호출하기에 0으로 설정
threshold: 0,
- //아래 ref div가 보이고 나서 몇초후에 이벤트 발생할지
delay: 0,
});
useEffect(() => {
- //처음엔 false 화면에 안보이면 false임, 보이면 true로 변함
if (inView) {
- //데이터 가져오고 있는데 또 가져오지 않기 위해 isFetching까지
!isFetching && hasNextPage && fetchNextPage();
}
}, [inView, hasNextPage, fetchNextPage, isFetching]);
- //전체적으로 client component 더 분리해보기 (일단 로직 작성 하고 나서 )
return (
<>
@@ -212,7 +178,7 @@ export default function AllGroupTabs() {
-
-
))}
@@ -361,9 +280,9 @@ export default function AllGroupTabs() {