Skip to content

Commit

Permalink
types.ts in api folder and edit profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Princekumarofficial committed Jun 25, 2024
1 parent 83eace2 commit 3957ec8
Show file tree
Hide file tree
Showing 13 changed files with 352 additions and 513 deletions.
2 changes: 1 addition & 1 deletion src/app/(routes)/recruiter/events/[jobId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";
import React from "react";
import { useState, useEffect } from "react";
import { JobDetailFC } from "@/helpers/recruiter/api";
import { JobDetailFC } from "@/helpers/recruiter/types";
import Cookies from "js-cookie";
import { getJobDetail } from "@/helpers/recruiter/api";
import loadingImg from "@/../public/loadingSpinner.svg";
Expand Down
2 changes: 1 addition & 1 deletion src/app/(routes)/recruiter/events/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";
import React from "react";
import { useState, useEffect } from "react";
import { JobsFC } from "@/helpers/recruiter/api";
import { JobsFC } from "@/helpers/recruiter/types";
import Cookies from "js-cookie";
import { getJobs } from "@/helpers/recruiter/api";
import toast from "react-hot-toast";
Expand Down
21 changes: 0 additions & 21 deletions src/app/(routes)/recruiter/jaf/[jaf]/page.tsx

This file was deleted.

5 changes: 2 additions & 3 deletions src/app/(routes)/recruiter/jobs/[jobID]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client";
import React, { useState, useEffect } from "react";
import { JobDetailFC } from "@/helpers/recruiter/api";
import { JobDetail } from "@/dummyData/Recruiters";
import { JobDetailFC } from "@/helpers/recruiter/types";
import Cookies from "js-cookie";
import { getJobDetail } from "@/helpers/recruiter/api";
import loadingImg from "@/../public/loadingSpinner.svg";
Expand All @@ -11,7 +10,7 @@ import { Button } from "@/components/ui/button";
import Link from "next/link";
import { Separator } from "@/components/ui/separator";
import { getJafDetails } from "@/helpers/recruiter/api";
import { JAFdetailsFC } from "@/helpers/recruiter/api";
import { JAFdetailsFC } from "@/helpers/recruiter/types";
import { patchJobData } from "@/helpers/recruiter/api";
import { patchSalaryData } from "@/helpers/recruiter/api";

Expand Down
2 changes: 1 addition & 1 deletion src/app/(routes)/recruiter/jobs/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";
import React from "react";
import { getJobs } from "@/helpers/recruiter/api";
import { JobsFC } from "@/helpers/recruiter/api";
import { JobsFC } from "@/helpers/recruiter/types";
import { useState, useEffect } from "react";
import Cookies from "js-cookie";
import loadingImg from "@/../public/loadingSpinner.svg";
Expand Down
135 changes: 0 additions & 135 deletions src/app/(routes)/recruiter/prevjaf/[jaf]/page.tsx

This file was deleted.

44 changes: 0 additions & 44 deletions src/app/(routes)/recruiter/profile/edit/page.tsx

This file was deleted.

16 changes: 13 additions & 3 deletions src/app/(routes)/recruiter/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import RecruiterProfile from "@/components/Recruiters/profile";
import { fetchProfile } from "@/helpers/recruiter/api";
import Cookies from "js-cookie";
import loadingImg from "@/../public/loadingSpinner.svg";
import { ProfileFC } from "@/helpers/recruiter/api";
import { ProfileFC } from "@/helpers/recruiter/types";
import EditProfilePage from "@/components/Recruiters/editProfile";

const Profile = ({ params }: { params: { RecruiterId: string } }) => {
const Profile = () => {
const [data, setData] = useState<ProfileFC>();
const [loading, setLoading] = useState(true);
const [editMode, setEditMode] = useState(false);

useEffect(() => {
const profileData = async () => {
Expand All @@ -23,7 +25,15 @@ const Profile = ({ params }: { params: { RecruiterId: string } }) => {
return (
<div className="h-screen flex justify-center">
{loading && <img src={loadingImg.src} width={200} />}
{data && <RecruiterProfile profile={data} />}
{data &&
(editMode ? (
<EditProfilePage data={data} />
) : (
<RecruiterProfile
profile={data}
setEdit={() => setEditMode(!editMode)}
/>
))}
</div>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/Recruiters/Events.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use client";
import React from "react";
import { useState, useEffect } from "react";
import { getEvent, JobDetailFC } from "@/helpers/recruiter/api";
import { getEvent } from "@/helpers/recruiter/api";
import Cookies from "js-cookie";
import loadingImg from "@/../public/loadingSpinner.svg";
import { EventFC, ApplicationFC } from "@/helpers/recruiter/api";
import { EventFC, ApplicationFC, JobDetailFC } from "@/helpers/recruiter/types";
import { CircularProgress } from "@mui/material";
import { getResume } from "@/helpers/recruiter/api";
import VerifiedIcon from "@mui/icons-material/Verified";
Expand Down
19 changes: 18 additions & 1 deletion src/components/Recruiters/editProfile.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react";
import { ProfileFC, updateProfileFC } from "@/helpers/recruiter/api";
import { ProfileFC, updateProfileFC } from "@/helpers/recruiter/types";
import { Button } from "../ui/button";
import { patchProfile } from "@/helpers/recruiter/api";
import Cookies from "js-cookie";
Expand Down Expand Up @@ -333,3 +333,20 @@ export const EditCompanyForm = (params: { profile: ProfileFC }) => {
</div>
);
};

const EditProfilePage = ({ data }: { data: ProfileFC }) => {
return (
<div className="flex md:flex-row flex-col justify-around w-full">
<div className="">
<h2 className="text-xl font-bold text-center">Company Details</h2>
<EditCompanyForm profile={data} />
</div>
<div className="">
<h2 className="text-xl font-bold text-center">Profile Details</h2>
<EditForm profile={data} />
</div>
</div>
);
};

export default EditProfilePage;
Loading

0 comments on commit 3957ec8

Please sign in to comment.