Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

내 기업정보 수정 모달 구현 #150

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions apps/company/src/app/company/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@ import SeeMoreIcon from "../../../public/seemore.svg";
import { themes } from "@jobis/design-token";
import { CompanyContentTemplate } from "@/components/companyContentTemplate";
import { useMyCompanyInfo } from "@/hooks/apis/useCompanyApi";
import { useModal } from "@/hooks/useModal";
import EditModal from "@/components/modal/editModal/editModal";

export default function Company() {
const { data: myCompanyInfo } = useMyCompanyInfo();
const { modalState, closeModal, openModal } = useModal();

const handleIconClick = () => {
if (modalState === "EDIT_COMPANY_INFO") {
closeModal();
} else {
openModal("EDIT_COMPANY_INFO");
}
};

return (
<S.Container>
<S.Title>
Expand All @@ -33,7 +45,17 @@ export default function Company() {
</Text>
</div>
</Flex>
<Image src={SeeMoreIcon} alt="더보기" style={{ cursor: "pointer" }} />
<S.IconWrapper>
<Image
src={SeeMoreIcon}
alt="더보기"
style={{ cursor: "pointer" }}
onClick={() => handleIconClick()}
/>
{modalState === "EDIT_COMPANY_INFO" && (
<EditModal closeModal={closeModal} />
)}
</S.IconWrapper>
</S.Title>
<S.Line />
<Flex gap={128} justify={"space-between"}>
Expand All @@ -47,7 +69,7 @@ export default function Company() {
content={myCompanyInfo?.company_introduce}
/>
<CompanyContentTemplate
title={myCompanyInfo?.headquarter === true ? "본사(주소)" : "주소"}
title={myCompanyInfo?.headquarter === true ? "주소(본사)" : "주소"}
content={myCompanyInfo?.main_address}
/>
<CompanyContentTemplate
Expand Down
5 changes: 5 additions & 0 deletions apps/company/src/app/company/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ export const Line = styled.div`
width: 960px;
}
`;

export const IconWrapper = styled.div`
position: relative;
display: inline-block;
`;
1 change: 0 additions & 1 deletion apps/company/src/app/my/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default function My() {
const router = useRouter();
const { data: myCompanyInfo } = useMyCompanyInfo();
const { data: myRecruitmentList } = useMyRecruitmentList();

const hasRecruitments = myRecruitmentList?.my_recruitments;

return (
Expand Down
40 changes: 40 additions & 0 deletions apps/company/src/components/modal/editModal/editModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"use client";

import React from "react";
import * as S from "./style";
import { Text } from "@jobis/ui";
import { themes } from "@jobis/design-token";
import Link from "next/link";
import { useMyCompanyInfo } from "@/hooks/apis/useCompanyApi";
import { useEffect } from "react";

interface PropsType {
closeModal: () => void;
}

const EditModal: React.FC<PropsType> = () => {
const { data: myCompanyInfo } = useMyCompanyInfo();
useEffect(() => {
document.body.style.overflow = "auto";
return () => {
document.body.style.overflow = "auto";
};
}, []);

return (
<S.Container>
<Link
href={`/registration?name=${myCompanyInfo?.name}&business-number=${myCompanyInfo?.biz_no}&type=edit`}
>
<Text fontSize="caption" color={themes.Color.grayScale[60]}>
수정
</Text>
</Link>
<Text fontSize="caption" color={themes.Color.grayScale[60]}>
로그아웃
</Text>
</S.Container>
);
};

export default EditModal;
21 changes: 21 additions & 0 deletions apps/company/src/components/modal/editModal/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { themes } from "@jobis/design-token";
import { styled } from "styled-components";

export const Container = styled.div`
position: absolute;
right: 50%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 120px;
padding-top: 16px;
padding-bottom: 16px;
border: 1px solid ${themes.Color.grayScale[30]};
border-radius: 8px;

background-color: white;
cursor: pointer;
gap: 16px;
box-shadow: 0 4px 20px 0 rgb(112 144 176 / 12%);
`;
1 change: 1 addition & 0 deletions apps/company/src/store/modalStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type ModalType =
| "LICENSE"
| "EDIT_RECRUIT_AREA"
| "ADD_RECRUIT_AREA"
| "EDIT_COMPANY_INFO"
| "";

export interface IModalState {
Expand Down