Skip to content

Commit

Permalink
merge :: 내 기업정보 페이지 값 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
eejx0 authored Nov 6, 2024
2 parents 3073bca + 751e8a0 commit 90bd968
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 21 deletions.
1 change: 1 addition & 0 deletions apps/company/src/apis/company/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface IUpdateCompanyInfoRequest {
company_profile_url?: string;
service_name: string;
business_area_code: number | string;
manager_phone_no: string;
}
export interface ICompanyRegisterRequest extends IUpdateCompanyInfoRequest {
name: string;
Expand Down
61 changes: 60 additions & 1 deletion apps/company/src/app/company/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import Image from "next/image";
import * as S from "./style";
import { Text, Flex } from "@jobis/ui";
import { Text, Flex, Icon } from "@jobis/ui";
import SeeMoreIcon from "../../../public/seemore.svg";
import { themes } from "@jobis/design-token";
import { CompanyContentTemplate } from "@/components/companyContentTemplate";
Expand Down Expand Up @@ -114,6 +114,65 @@ export default function Company() {
title="대표 번호"
content={myCompanyInfo?.representative_phone_no}
/>
<CompanyContentTemplate
title="사업자 등록증"
content={
myCompanyInfo?.biz_registration_url ? (
<S.FileWrapper type="button">
<Flex align="center" gap={4}>
<Icon
icon="FileEarmarkArrowDown"
size={16}
color={themes.Color.grayScale[60]}
/>
<Text
fontSize="body3"
fontWeight="regular"
color={themes.Color.grayScale[60]}
whiteSpace="nowrap"
style={{ textOverflow: "ellipsis", maxWidth: 500 }}
>
{myCompanyInfo.biz_registration_url
.split("/")
.pop()
?.replace(/^[\w-]+-/, "")}
</Text>
</Flex>
</S.FileWrapper>
) : null
}
/>
<CompanyContentTemplate
title="파일첨부"
content={
myCompanyInfo?.attachment_urls &&
myCompanyInfo.attachment_urls.length > 0
? myCompanyInfo.attachment_urls.map((file, idx) => (
<S.FileWrapper type="button" key={idx}>
<Flex align="center" gap={4}>
<Icon
icon="FileEarmarkArrowDown"
size={16}
color={themes.Color.grayScale[60]}
/>
<Text
fontSize="body3"
fontWeight="regular"
color={themes.Color.grayScale[60]}
whiteSpace="nowrap"
style={{ textOverflow: "ellipsis", maxWidth: 500 }}
>
{file
.split("/")
.pop()
?.replace(/^[\w-]+-/, "")}
</Text>
</Flex>
</S.FileWrapper>
))
: null
}
/>
</Flex>
</Flex>
</S.Container>
Expand Down
12 changes: 12 additions & 0 deletions apps/company/src/app/company/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,15 @@ export const IconWrapper = styled.div`
position: relative;
display: inline-block;
`;

export const FileWrapper = styled.button`
display: flex;
align-items: center;
padding: 4px 8px;
border: none;
border-radius: 88px;
background-color: ${themes.Color.grayScale[30]};
outline: none;
gap: 12px;
`;
51 changes: 35 additions & 16 deletions apps/company/src/app/registration/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,7 @@ import {
import { themes } from "@jobis/design-token";
import { Controller, SubmitHandler, useForm } from "react-hook-form";
import { ICompanyRegisterRequest } from "@/apis/company/types";
import {
RefObject,
TextareaHTMLAttributes,
useCallback,
useEffect,
useRef,
useState,
} from "react";
import { RefObject, useCallback, useEffect, useRef, useState } from "react";
import { useModal } from "@/hooks/useModal";
import { Address } from "react-daum-postcode";
import DaumPostcode from "react-daum-postcode";
Expand All @@ -42,7 +35,6 @@ import {
} from "@/hooks/apis/useCompanyApi";
import { useGetCode } from "@/hooks/apis/useCodeApi";
import { AxiosError } from "axios";
import { Background } from "@/components/modal/style";

export default function Registration() {
const searchParams = useSearchParams();
Expand Down Expand Up @@ -85,6 +77,7 @@ export default function Registration() {
manager_name: myCompanyInfo?.manager_name || "",
company_profile_url: myCompanyInfo?.company_logo_url,
headquarter: myCompanyInfo?.headquarter || false,
manager_phone_no: myCompanyInfo?.manager_phone_no || "",
},
});
const { toast } = useToast();
Expand Down Expand Up @@ -365,6 +358,36 @@ export default function Registration() {
errorMessage={errors.business_number?.message}
/>
</InputTemplate>,
<InputTemplate
key="representative_phone_no"
title="기업 대표번호"
required
>
<Controller
control={control}
name="representative_phone_no"
rules={{
required: "필수 입력 항목입니다.",
pattern: {
value: /^\d{2,3}-\d{3,4}-\d{4}$/,
message: "유효한 전화번호 형식이 아닙니다.",
},
}}
render={({ field }) => (
<Input
{...field}
type="tel"
width={604}
placeholder="nnn-nnnn-nnnn"
maxLength={13}
onChange={e =>
field.onChange(regex.phone_number(e.target.value))
}
errorMessage={errors.representative_phone_no?.message}
/>
)}
/>
</InputTemplate>,
<InputTemplate key="representative-name" title="대표자" required>
<Input
width={604}
Expand Down Expand Up @@ -559,14 +582,10 @@ export default function Registration() {
errorMessage={errors.manager_name?.message}
/>
</InputTemplate>
<InputTemplate
key="representative_phone_no"
title="대표 연락처"
required
>
<InputTemplate key="manager_phone_no" title="전화번호" required>
<Controller
control={control}
name="representative_phone_no"
name="manager_phone_no"
rules={{
required: "필수 입력 항목입니다.",
pattern: {
Expand All @@ -584,7 +603,7 @@ export default function Registration() {
onChange={e =>
field.onChange(regex.phone_number(e.target.value))
}
errorMessage={errors.representative_phone_no?.message}
errorMessage={errors.manager_phone_no?.message}
/>
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as S from "./style";

interface PropType {
title: string;
content?: string | number;
content?: React.ReactNode;
}

export const CompanyContentTemplate = ({ title, content }: PropType) => {
Expand Down
9 changes: 6 additions & 3 deletions apps/company/src/components/modal/editModal/editModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ const EditModal: React.FC<PropsType> = () => {
return (
<S.Container>
<Link
style={{ width: "100%", height: "100%" }}
href={`/registration?name=${myCompanyInfo?.name}&business-number=${myCompanyInfo?.biz_no}&type=edit`}
>
<Text fontSize="caption" color={themes.Color.grayScale[60]}>
수정
</Text>
<S.Box>
<Text fontSize="caption" color={themes.Color.grayScale[60]}>
수정
</Text>
</S.Box>
</Link>
<Text fontSize="caption" color={themes.Color.grayScale[60]}>
로그아웃
Expand Down
9 changes: 9 additions & 0 deletions apps/company/src/components/modal/editModal/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ export const Container = styled.div`
gap: 16px;
box-shadow: 0 4px 20px 0 rgb(112 144 176 / 12%);
`;

export const Box = styled.div`
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 50%;
cursor: pointer;
`;

0 comments on commit 90bd968

Please sign in to comment.