Skip to content

Commit

Permalink
πŸ› fix: νšŒμ›κ°€μž… λ™μ˜ λͺ¨λ‹¬ μ•ˆ λ‹«νžˆλŠ” μ—λŸ¬ ν•΄κ²° Team-inglo#73
Browse files Browse the repository at this point in the history
  • Loading branch information
naarang committed Oct 31, 2024
1 parent fa91772 commit 5c8536e
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 25 deletions.
23 changes: 15 additions & 8 deletions src/components/Employer/Profile/EmployerJobInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
import { EmployerInfoData } from '@/constants/profile';
// import { useGetOwnerApplicationCounts } from '@/hooks/api/useProfile';
import { useGetOwnerApplicationCounts } from '@/hooks/api/useProfile';
import { EmployerCountsInfoResponse } from '@/types/api/profile';
import { useEffect, useState } from 'react';

const EmployerJobInfo = () => {
// const { data } = useGetOwnerApplicationCounts();
const data = EmployerInfoData;
const { data } = useGetOwnerApplicationCounts();
const [jobData, setJobData] = useState<EmployerCountsInfoResponse>();

useEffect(() => {
if (data) {
setJobData(data.data);
}
}, [data]);

return (
<>
{data && data.success ? (
{jobData ? (
<div className="flex gap-4 items-center justify-between">
<div className="flex flex-col gap-3 w-24 py-2 px-1">
<div className="body-3 text-[#1E1926] text-center">올린 곡고</div>
<div className="head-3 text-[#1E1926] text-center">
{data.data.job_postings_counts}
{jobData.job_postings_counts}
</div>
</div>
<div className="flex flex-col gap-3 py-2 px-1">
<div className="body-3 text-[#1E1926] text-center">μ§€μ›μž 총합</div>
<div className="head-3 text-[#1E1926] text-center">
{data.data.applicants_counts}
{jobData.applicants_counts}
</div>
</div>
<div className="flex flex-col gap-3 w-24 py-2 px-1">
<div className="body-3 text-[#1E1926] text-center">계약 성곡</div>
<div className="head-3 text-[#1E1926] text-center">
{data.data.successful_hire_counts}
{jobData.successful_hire_counts}
</div>
</div>
</div>
Expand Down
20 changes: 13 additions & 7 deletions src/components/Employer/Profile/EmployerProfileCard.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
import { EmployerSummaryData } from '@/constants/profile';
// import { usegetOwnerSummaries } from '@/hooks/api/useProfile';
import { usegetOwnerSummaries } from '@/hooks/api/useProfile';
import { EmployerProfileResponse } from '@/types/api/profile';
import { useEffect, useState } from 'react';

const EmployerProfileCard = () => {
// const { data } = usegetOwnerSummaries();
const data = EmployerSummaryData;
const { data } = usegetOwnerSummaries();
const [profileData, setProfileData] = useState<EmployerProfileResponse>();

useEffect(() => {
if (data) {
setProfileData(data.data);
}
}, [data]);
return (
<>
{data && data.success ? (
{profileData ? (
<div className="pt-5 pb-4 flex items-center gap-4">
<div className="w-20 h-20 rounded-full overflow-hidden">
<img src={data?.data.icon_img_url} alt="profile image" />
<img src={profileData.icon_img_url} alt="profile image" />
</div>
<h1 className="head-3 text-[#1E1926]">{data?.data.company_name}</h1>
<h1 className="head-3 text-[#1E1926]">{profileData.company_name}</h1>
</div>
) : (
<div>λ‘œλ”© 쀑</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Employer/Signup/AgreeModalInner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ const AgreeModalInner = ({
title="Agree"
onClick={
essentialAgreeList.slice(0, 3).includes(false)
? handleNext
: undefined
? undefined
: handleNext
}
/>
</div>
Expand Down
9 changes: 8 additions & 1 deletion src/components/Profile/ProfileHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { headerTranslation } from '@/constants/translation';
import { isEmployer } from '@/utils/signup';
import { useLocation } from 'react-router-dom';

const ProfileHeader = () => {
const { pathname } = useLocation();
return (
<section className="w-full h-[3.5rem] flex justify-center items-center">
<span className="head-3 text-[#464646]">Profile</span>
<span className="head-3 text-[#464646]">
{headerTranslation.profile[isEmployer(pathname)]}
</span>
</section>
);
};
Expand Down
11 changes: 4 additions & 7 deletions src/components/Profile/ProfileMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import LogoutIcon from '@/assets/icons/Profile/LogoutIcon.svg?react';
import ToggleBar from '@/assets/icons/Profile/ToggleBar.svg?react';
import ToggleButton from '@/assets/icons/Profile/ToggleButton.svg?react';
import { usePatchNotificationAllowed } from '@/hooks/api/useSetting';
import { useGetUserSummaries } from '@/hooks/api/useProfile';
import { usegetOwnerSummaries } from '@/hooks/api/useProfile';

type ProfileMenuProps = {
title: string;
Expand All @@ -25,17 +25,14 @@ const ProfileMenu = ({
isToggle,
}: ProfileMenuProps) => {
const { mutate: patchNotificationAllowed } = usePatchNotificationAllowed();
const { data: notificaionAllowed } = useGetUserSummaries();
const { data: notificaionAllowed } = usegetOwnerSummaries();

// const { data } = useGetUserSummaries();
const [toggleOn, setToggleOn] = useState<boolean>(false);

useEffect(() => {
// μ•Œλ¦Ό μ„€μ • μƒνƒœ 뢈러였기
if (isToggle && notificaionAllowed && notificaionAllowed.success) {
setToggleOn(
notificaionAllowed.data.user_information.is_notification_allowed,
);
if (isToggle && notificaionAllowed) {
setToggleOn(notificaionAllowed.data.is_notification_allowed);
}
}, []);

Expand Down
7 changes: 7 additions & 0 deletions src/constants/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,10 @@ export const profileTranslation = {
en: 'Delete',
},
};

export const headerTranslation = {
profile: {
ko: 'ν”„λ‘œν•„',
en: 'Profile',
},
};

0 comments on commit 5c8536e

Please sign in to comment.