Skip to content

Commit

Permalink
feat: add applicant label node
Browse files Browse the repository at this point in the history
  • Loading branch information
loopy-lim committed Aug 22, 2023
1 parent 6000251 commit 2468ca7
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 35 deletions.
2 changes: 1 addition & 1 deletion frontend/app/applicant/[generation]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const ApplicantPage: FC<ApplicantPageProps> = ({ params }) => {
<div className="px-24 w-max-[1280px] flex p-12">
<CommonNavbar generation={generation} />
<div className="flex-1 ml-32 min-w-[46rem]">
<ApplicantBoard />
<ApplicantBoard generation={generation} />
</div>
</div>
);
Expand Down
9 changes: 7 additions & 2 deletions frontend/components/applicant/Board.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@ import Board from "@/components/common/board/Board.component";
import { getApplicant } from "@/src/apis/applicant";
import ApplicantDetailRight from "./DetailRight.component";
import ApplicantDetailLeft from "./DetailLeft.component";
import { FC } from "react";

const getApplicantDetailData = async (applicantId: string) => {
return await getApplicant(applicantId);
};

const ApplicantBoard = async () => {
interface ApplicantBoardProps {
generation: string;
}

const ApplicantBoard: FC<ApplicantBoardProps> = async ({ generation }) => {
const data = await getApplicantDetailData("22");

return (
<Board baseUrl={""} wapperClassname="divide-x">
<div className="flex flex-1 min-h-0">
<div className="flex-1 overflow-auto px-12">
<ApplicantDetailLeft data={data} />
<ApplicantDetailLeft data={data} postId={"22"} />
</div>
</div>
<div className="flex flex-1 min-h-0">
Expand Down
8 changes: 7 additions & 1 deletion frontend/components/applicant/DetailLeft.component.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { ApplicantReq } from "@/src/apis/applicant";
import { FC } from "react";
import ApplicantResource from "./applicantNode/CustomResource.component";
import ApplicantLabel from "./applicantNode/Label.component";

interface ApplicantDetailLeftProps {
data: ApplicantReq[];
postId: string;
}

const ApplicantDetailLeft: FC<ApplicantDetailLeftProps> = ({ data }) => {
const ApplicantDetailLeft: FC<ApplicantDetailLeftProps> = ({
data,
postId,
}) => {
return (
<>
<ApplicantResource data={data} />
<ApplicantLabel postId={postId} />
</>
);
};
Expand Down
20 changes: 20 additions & 0 deletions frontend/components/applicant/applicantNode/Label.component.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { getApplicantLabel } from "@/src/apis/applicant";
import { FC } from "react";

interface ApplicantLabelProps {
postId: string;
}

const ApplicantLabel: FC<ApplicantLabelProps> = async ({ postId }) => {
const data = await getApplicantLabel(postId);

return (
<>
{data.map((label, index) => (
<div key={index}>{label.name}</div>
))}
</>
);
};

export default ApplicantLabel;
13 changes: 13 additions & 0 deletions frontend/src/apis/applicant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,16 @@ export const getApplicant = async (id: string) => {

return data;
};

export interface ApplicnatLabelReq {
name: string;
active: boolean;
}

export const getApplicantLabel = async (id: string) => {
const { data } = await https.get<ApplicnatLabelReq[]>(
`/applicants/${id}/label`
);

return data;
};
31 changes: 0 additions & 31 deletions frontend/src/constants/applicant/26.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,34 +89,3 @@ export const APPLICANT = [
type: "timeline",
} as ApplicantTimelineNode,
] as ApplicantNode[];

export const APPLICANT_RESOURCES = [
{
value: [
{
name: "field",
},
{
name: "field1",
},
{
name: "field2",
},
{
name: "field",
},
{
name: "name",
},
{
name: "major",
},
{
name: "portfolio",
},
{
name: "fileUrl",
},
],
},
];

0 comments on commit 2468ca7

Please sign in to comment.