-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/#53-NoticeApi
- Loading branch information
Showing
41 changed files
with
693 additions
and
173 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
"use client"; | ||
|
||
import { useState } from "react"; | ||
import ReviewForm from "@/components/company/ReviewForm"; | ||
import FillBtn from "@/components/common/Button/FillBtn"; | ||
import { useRouter, useSearchParams } from "next/navigation"; | ||
import { useCreateReviews } from "@/apis/reviews"; | ||
import { qnaElementsType } from "@/apis/reviews/type"; | ||
|
||
export default function CreateReviews() { | ||
const router = useRouter(); | ||
const params = useSearchParams(); | ||
const companyId = Number(params.get('id')) | ||
const [qnaElements, setQnaElements] = useState<qnaElementsType[]>([ | ||
{ question: "", answer: "", code_id: 0 }, | ||
]); | ||
const mutateOption = { | ||
onSuccess: () => { | ||
router.push(`/companies/reviews/?id=${companyId}`) | ||
} | ||
} | ||
const { mutate: createReviews } = useCreateReviews(mutateOption); | ||
|
||
const handleClickCreateRevies = () => { | ||
createReviews({ | ||
company_id:companyId, | ||
qna_elements: qnaElements | ||
}) | ||
} | ||
|
||
const handleChange = ( | ||
index: number, | ||
name: keyof qnaElementsType, | ||
value: string | number | ||
) => { | ||
setQnaElements(prev => { | ||
const newReviews = [...prev]; | ||
if (typeof value === "number") { | ||
newReviews[index].code_id = value; | ||
} else if (name !== "code_id") { | ||
newReviews[index][name] = value; | ||
} | ||
return newReviews; | ||
}); | ||
}; | ||
|
||
const removeReviewList = (index: number) => { | ||
setQnaElements(prev=>{ | ||
let newReviews = [...prev]; | ||
newReviews = newReviews.filter((_,idx)=>idx !== index); | ||
return newReviews; | ||
}) | ||
} | ||
|
||
return ( | ||
<div className="w-2/3 mx-auto my-5"> | ||
<p className="py-12 leading-10 text-center text-h4 font-b text-primaryBlue03"> | ||
후기작성 | ||
</p> | ||
{qnaElements | ||
.map((qnaElement, idx) => ( | ||
<ReviewForm key={idx} onChange={handleChange} removeReviews={removeReviewList} setState={setQnaElements} index={idx} {...qnaElement} /> | ||
))} | ||
<div className="flex justify-between"> | ||
<FillBtn | ||
backgroundColor="#ccc" | ||
onClick={() => { | ||
setQnaElements(prev => ([ | ||
...prev, | ||
{ question: "", answer: "", code_id: 0 } | ||
])); | ||
}} | ||
> | ||
면접질문 추가 | ||
</FillBtn> | ||
<div className="flex gap-3"> | ||
<FillBtn | ||
backgroundColor="#ccc" | ||
onClick={() => { | ||
router.back(); | ||
}} | ||
> | ||
이전으로 | ||
</FillBtn> | ||
<FillBtn onClick={handleClickCreateRevies}>완료</FillBtn> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export default function EmploymentStatus() { | ||
return ( | ||
<main className="w-full py-12"> | ||
<section> | ||
<div className="w-full h-[200px] bg-white shadow-[0px_4px_20px_0px_rgba(112,144,176,0.12)] rounded-[12px] py-[33px] px-[47px]"> | ||
<h3 className="text-h5 font-bold">2023학년도 DSM의 <span className="text-[#237BC9]">취업률</span>을 확인해 보세요</h3> | ||
<p className="text-b3 text-[#7f7f7f]">현재 <span className="text-[#237BC9]">100%</span>의 학생들이 취업에 성공했어요!</p> | ||
</div> | ||
</section> | ||
</main> | ||
) | ||
} |
Oops, something went wrong.