Skip to content

Commit

Permalink
Merge branch 'hoxfix' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
KANGYONGSU23 committed Nov 7, 2023
2 parents b4eef97 + 21910c7 commit 567d143
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 32 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build && next export",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
Expand Down
7 changes: 4 additions & 3 deletions src/apis/recruitments/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ export interface RecruitmentsDetailType extends RecruitmentsDetailTable {

export interface RecruitmentsDetailTable {
areas: AreasType[];
preferential_treatment: string;
required_grade: number | null;
work_hours: number;
start_time: string;
end_time: string;
required_licenses: string[] | [];
hiring_progress: HiringProgressType[];
train_pay: number;
pay: number;
pay: string | null;
benefits: string | null;
military: boolean;
submit_document: string;
Expand All @@ -42,6 +42,7 @@ export interface AreasType {
tech: string[];
hiring: number;
major_task: string;
preferential_treatment: string | null;
}

export interface GetNumberOfPagesType {
Expand Down
6 changes: 3 additions & 3 deletions src/apis/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ export const Login = (body: RequestBody, checkBoxValue: boolean) => {
},
{
onSuccess: (res) => {
if (res.authority !== "STUDENT") {
if (res.authority !== "STUDENT" && res.authority !== "DEVELOPER") {
append({
title: "해당 서비스를 사용할 수 없는 계정입니다.",
message: "",
title: "",
message: "해당 서비스를 이용할 수 없는 계정입니다.",
type: "RED",
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/apis/user/type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type AuthorityType = "TEACHER" | "STUDENT" | "COMPANY";
type AuthorityType = "TEACHER" | "STUDENT" | "COMPANY" | "DEVELOPER";

export interface RequestBody {
account_id: string;
Expand Down
11 changes: 4 additions & 7 deletions src/components/account/login/loginInputsComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import React, { useState } from "react";
interface PropsType {
inputStates: RequestBody;
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
enterEvent: () => void;
}

function LoginInputs({ inputStates, handleChange }: PropsType) {
const [isHidden, setIsHidden] = useState<boolean>(true);
function LoginInputs({ inputStates, handleChange, enterEvent }: PropsType) {
return (
<div className="flex flex-col gap-[14px] pt-[40px] pb-[12px] px-0">
<TextFiled
Expand All @@ -30,11 +30,8 @@ function LoginInputs({ inputStates, handleChange }: PropsType) {
name="password"
label="비밀번호"
placeholder="비밀번호를 입력해주세요"
enterEvent={() => {
setIsHidden((prev) => !prev);
}}
customType={isHidden ? "EyesClose" : "EyesOpen"}
type={isHidden ? "password" : "text"}
enterEvent={enterEvent}
type="password"
/>
</div>
);
Expand Down
6 changes: 5 additions & 1 deletion src/components/account/login/loginStateManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ export default function LoginStateMenagement() {

return (
<div>
<LoginInputs inputStates={inputStates} handleChange={handleChange} />
<LoginInputs
inputStates={inputStates}
handleChange={handleChange}
enterEvent={loginClick}
/>
<SubmitBtn
allIsInputState={allIsInputState}
isChecked={isChecked}
Expand Down
24 changes: 15 additions & 9 deletions src/components/common/TextFiled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Icon, theme } from "@team-return/design-system";
import React, { KeyboardEvent, useState } from "react";

interface PropsType extends React.ComponentProps<"input"> {
customType?: "Text" | "Search" | "EyesClose" | "EyesOpen";
customType?: "Search" | "EyesClose" | "EyesOpen";
enterEvent?: () => void;
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
label?: string;
Expand All @@ -16,16 +16,18 @@ function TextFiled({
value,
placeholder,
onChange,
customType = "Text",
customType,
name,
enterEvent,
width,
height,
label,
type,
type = "text",
}: PropsType) {
const [focus, setFocuse] = useState<boolean>(false);
const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {
const [isHidden, setIsHidden] = useState<boolean>(true);

const isKeyDownToEnter = (e: KeyboardEvent<HTMLInputElement>) => {
if (e.key === "Enter") if (enterEvent) enterEvent();
};

Expand All @@ -47,25 +49,29 @@ function TextFiled({
>
<input
className="w-full flex-1 h-full px-[16px] border-none text-b3 font-r leading-b3"
type={type}
type={type === "password" ? (isHidden ? "password" : "text") : type}
value={value}
onChange={onChange}
placeholder={placeholder}
name={name}
onKeyUp={onKeyDown}
onKeyUp={isKeyDownToEnter}
onFocus={() => {
setFocuse(true);
}}
onBlur={() => {
setFocuse(false);
}}
/>
{customType !== "Text" && (
{type !== "text" && (
<div
className="flex justify-center items-center mr-[14px] cursor-pointer "
onClick={enterEvent}
onClick={() => setIsHidden((prev) => !prev)}
>
<Icon icon={customType} size={20} color="gray60" />
<Icon
icon={isHidden ? "EyesClose" : "EyesOpen"}
size={20}
color="gray60"
/>
</div>
)}
</div>
Expand Down
19 changes: 12 additions & 7 deletions src/components/recruitments/RecruitmentsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

import { RecruitmentsDetailTable } from "@/apis/recruitments/type";
import { hiringProgressEnum } from "@/util/enum";
import { time_parsing } from "@/util/regex";
import { Icon } from "@team-return/design-system";
import React, { useState } from "react";

function RecruitmentsTable({ ...rest }: RecruitmentsDetailTable) {
const {
areas,
preferential_treatment,
required_grade,
work_hours,
start_time,
end_time,
required_licenses,
hiring_progress,
train_pay,
Expand Down Expand Up @@ -71,15 +72,17 @@ function RecruitmentsTable({ ...rest }: RecruitmentsDetailTable) {
<td className="key detail">수행업무</td>
<td className="value detail">{item.major_task}</td>
</tr>
<tr>
<td className="key detail">우대사항</td>
<td className="value detail">
{item.preferential_treatment || "-"}
</td>
</tr>
</>
)}
</>
);
})}
<tr>
<td className="key">우대사항</td>
<td className="value">{preferential_treatment || "-"}</td>
</tr>
<tr>
<td className="key">최소성적</td>
<td className="value">{required_grade || "-"}</td>
Expand All @@ -92,7 +95,9 @@ function RecruitmentsTable({ ...rest }: RecruitmentsDetailTable) {
</tr>
<tr>
<td className="key">근무시간</td>
<td className="value">{work_hours} 시간</td>
<td className="value">
{time_parsing(start_time)} ~ {time_parsing(end_time)}
</td>
</tr>
<tr>
<td className="key">면접과정</td>
Expand Down
4 changes: 4 additions & 0 deletions src/util/regex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ export const pon_number_regex = (number: string | null) => {

return number;
};

export const time_parsing = (time: string) => {
return time.slice(0, 5);
};

0 comments on commit 567d143

Please sign in to comment.