-
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.
- Loading branch information
1 parent
88c98c1
commit 94da66a
Showing
4 changed files
with
108 additions
and
115 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,54 +1,54 @@ | ||
"use client"; | ||
// "use client"; | ||
|
||
import { usePathname, useRouter } from "next/navigation"; | ||
import { useToastStore } from "@team-return/design-system"; | ||
import CompanyTable from "@/components/company/CompanyTable"; | ||
import CompanyTitle from "@/components/company/CompanyTitle"; | ||
import { GetCompaniesDetail } from "@/apis/companies"; | ||
import { business_number_regex } from "@/util/regex"; | ||
// import { usePathname, useRouter } from "next/navigation"; | ||
// import { useToastStore } from "@team-return/design-system"; | ||
// import CompanyTable from "@/components/company/CompanyTable"; | ||
// import CompanyTitle from "@/components/company/CompanyTitle"; | ||
// import { GetCompaniesDetail } from "@/apis/companies"; | ||
// import { business_number_regex } from "@/util/regex"; | ||
|
||
export default function CompanyDetialPage() { | ||
const navigator = useRouter(); | ||
const { append } = useToastStore(); | ||
const pathname = usePathname(); | ||
const id = pathname.replace("/companies/", "").replace("/", ""); | ||
// const navigator = useRouter(); | ||
// const { append } = useToastStore(); | ||
// const pathname = usePathname(); | ||
// const id = pathname.replace("/companies/", "").replace("/", ""); | ||
|
||
const { data } = GetCompaniesDetail(id); | ||
// const { data } = GetCompaniesDetail(id); | ||
|
||
if (data) { | ||
const { | ||
business_number, | ||
company_name, | ||
company_profile_url, | ||
recruitment_id, | ||
...rest | ||
} = data.data; | ||
// if (data) { | ||
// const { | ||
// business_number, | ||
// company_name, | ||
// company_profile_url, | ||
// recruitment_id, | ||
// ...rest | ||
// } = data.data; | ||
|
||
const onClickRecruitments = () => { | ||
if (recruitment_id) { | ||
navigator.push(`/recruitments/${recruitment_id}`); | ||
} else { | ||
append({ | ||
title: "", | ||
message: "해당 기업은 모집의뢰서가 없습니다.", | ||
type: "BLUE", | ||
}); | ||
} | ||
}; | ||
// const onClickRecruitments = () => { | ||
// if (recruitment_id) { | ||
// navigator.push(`/recruitments/${recruitment_id}`); | ||
// } else { | ||
// append({ | ||
// title: "", | ||
// message: "해당 기업은 모집의뢰서가 없습니다.", | ||
// type: "BLUE", | ||
// }); | ||
// } | ||
// }; | ||
|
||
return ( | ||
<div className="w-full my-[56px]"> | ||
<CompanyTitle | ||
business_number={business_number_regex(business_number)} | ||
company_name={company_name} | ||
company_profile_url={company_profile_url} | ||
onClickRecruitments={onClickRecruitments} | ||
onClickInterview={() => { | ||
// 후기조회 링크이동 | ||
}} | ||
/> | ||
<CompanyTable {...rest} /> | ||
</div> | ||
); | ||
} | ||
// return ( | ||
// <div className="w-full my-[56px]"> | ||
// <CompanyTitle | ||
// business_number={business_number_regex(business_number)} | ||
// company_name={company_name} | ||
// company_profile_url={company_profile_url} | ||
// onClickRecruitments={onClickRecruitments} | ||
// onClickInterview={() => { | ||
// // 후기조회 링크이동 | ||
// }} | ||
// /> | ||
// <CompanyTable {...rest} /> | ||
// </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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,42 @@ | ||
"use client"; | ||
// "use client"; | ||
|
||
import TextFiled from "@/components/common/TextFiled"; | ||
import useForm from "@/hook/useForm"; | ||
import { useEffect, useState } from "react"; | ||
import { usePathname, useRouter, useSearchParams } from "next/navigation"; | ||
import CompanyCard from "@/components/CompanyCard"; | ||
// import TextFiled from "@/components/common/TextFiled"; | ||
// import useForm from "@/hook/useForm"; | ||
// import { useEffect, useState } from "react"; | ||
// import { usePathname, useRouter, useSearchParams } from "next/navigation"; | ||
// import CompanyCard from "@/components/CompanyCard"; | ||
|
||
export default function CompanyListPage() { | ||
const getParams = useSearchParams(); | ||
const [page, setPage] = useState(Number(getParams.get("page"))); | ||
const navigator = useRouter(); | ||
const pathname = usePathname(); | ||
const { state: searchState, onChange: onChangeSearch } = useForm<{ | ||
search: string | undefined; | ||
}>({ | ||
search: getParams.get("name")?.toString(), | ||
}); | ||
|
||
const onSearch = () => { | ||
navigator.push(`${pathname}?page=${page}&name=${searchState.search}`); | ||
}; | ||
|
||
useEffect(onSearch, [page]); | ||
|
||
return ( | ||
<div className="w-full mt-[68px]"> | ||
<div className="flex items-center justify-between w-full py-5"> | ||
<div className="flex gap-[10px] items-center text-h5 leading-h5 font-b"> | ||
<p>🏢 기업체</p> | ||
</div> | ||
<TextFiled | ||
width="40%" | ||
placeholder="검색어를 입력해주세요." | ||
value={searchState.search} | ||
onChange={onChangeSearch} | ||
name="search" | ||
customType="Search" | ||
iconClick={onSearch} | ||
/> | ||
</div> | ||
<CompanyCard /> | ||
</div> | ||
); | ||
// const getParams = useSearchParams(); | ||
// const [page, setPage] = useState(Number(getParams.get("page"))); | ||
// const navigator = useRouter(); | ||
// const pathname = usePathname(); | ||
// const { state: searchState, onChange: onChangeSearch } = useForm<{ | ||
// search: string | undefined; | ||
// }>({ | ||
// search: getParams.get("name")?.toString(), | ||
// }); | ||
// const onSearch = () => { | ||
// navigator.push(`${pathname}?page=${page}&name=${searchState.search}`); | ||
// }; | ||
// useEffect(onSearch, [page]); | ||
// return ( | ||
// <div className="w-full mt-[68px]"> | ||
// <div className="flex items-center justify-between w-full py-5"> | ||
// <div className="flex gap-[10px] items-center text-h5 leading-h5 font-b"> | ||
// <p>🏢 기업체</p> | ||
// </div> | ||
// <TextFiled | ||
// width="40%" | ||
// placeholder="검색어를 입력해주세요." | ||
// value={searchState.search} | ||
// onChange={onChangeSearch} | ||
// name="search" | ||
// customType="Search" | ||
// iconClick={onSearch} | ||
// /> | ||
// </div> | ||
// <CompanyCard /> | ||
// </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 |
---|---|---|
@@ -1,30 +1,28 @@ | ||
'use client' | ||
// 'use client' | ||
|
||
import { usePathname } from "next/navigation"; | ||
import { GetRecruitmentsDetail } from "@/apis/recruitments"; | ||
import RegisterBtn from "@/components/common/Button/RegisterBtn"; | ||
import CompanyTitle from "@/components/company/CompanyTitle"; | ||
import RecruitmentsTable from "@/components/recruitments/RecruitmentsTable"; | ||
// import { usePathname } from "next/navigation"; | ||
// import { GetRecruitmentsDetail } from "@/apis/recruitments"; | ||
// import RegisterBtn from "@/components/common/Button/RegisterBtn"; | ||
// import CompanyTitle from "@/components/company/CompanyTitle"; | ||
// import RecruitmentsTable from "@/components/recruitments/RecruitmentsTable"; | ||
|
||
export default function RecruitmentsDetailPage() { | ||
const pathname = usePathname(); | ||
const id = pathname.replace("/recruitments/", ""); | ||
|
||
const { data } = GetRecruitmentsDetail(id); | ||
if (data) { | ||
const { company_id, company_name, company_profile_url, ...rest } = | ||
data.data; | ||
|
||
return ( | ||
<div className="w-full my-[56px]"> | ||
<CompanyTitle | ||
company_name={company_name} | ||
company_profile_url={company_profile_url} | ||
> | ||
<RegisterBtn onClick={() => {}}>지원하기</RegisterBtn> | ||
</CompanyTitle> | ||
<RecruitmentsTable {...rest} /> | ||
</div> | ||
); | ||
} | ||
// const pathname = usePathname(); | ||
// const id = pathname.replace("/recruitments/", ""); | ||
// const { data } = GetRecruitmentsDetail(id); | ||
// if (data) { | ||
// const { company_id, company_name, company_profile_url, ...rest } = | ||
// data.data; | ||
// return ( | ||
// <div className="w-full my-[56px]"> | ||
// <CompanyTitle | ||
// company_name={company_name} | ||
// company_profile_url={company_profile_url} | ||
// > | ||
// <RegisterBtn onClick={() => {}}>지원하기</RegisterBtn> | ||
// </CompanyTitle> | ||
// <RecruitmentsTable {...rest} /> | ||
// </div> | ||
// ); | ||
// } | ||
} |