Skip to content

Commit

Permalink
빌드 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
KANGYONGSU23 committed Oct 4, 2023
1 parent 88c98c1 commit 94da66a
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 115 deletions.
92 changes: 46 additions & 46 deletions src/app/companies/[id]/page.tsx
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>
// );
// }
}
79 changes: 38 additions & 41 deletions src/app/companies/page.tsx
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>
// );
}
2 changes: 0 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client";

import Banner from "@/components/Carousel";
import Suggestion from "@/components/Suggestion";
import BandBanner from "@/components/BandBanner";
Expand Down
50 changes: 24 additions & 26 deletions src/app/recruitments/[id]/page.tsx
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>
// );
// }
}

0 comments on commit 94da66a

Please sign in to comment.