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

refactor(apply): redesign components of the my application page #761

Merged
merged 39 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bc579f7
refactor: 과제보기 컴포넌트 스타일 코드 개선 작업
woowahan-cron Jun 25, 2024
86676d0
refactor: 과제보기 컴포넌트 새로고침 버튼 개선 작업
woowahan-cron Jul 2, 2024
4c7e910
refactor: 새로고침 버튼 역할 분리
woowahan-cron Jul 2, 2024
5480ba6
refactor: JudgmentButton 훅 분리 작업
woowahan-cron Jul 2, 2024
2cb8366
refactor: 예제 테스트 실행 역할 분리
woowahan-cron Jul 2, 2024
6f417f9
refactor: MyMissionItem 훅 분리
woowahan-cron Jul 2, 2024
d218f86
refactor: Apply, Refresh, Judgment 버튼 삭제 및 버튼(Button) 컴포넌트 사용
woowahan-cron Jul 2, 2024
604377f
refactor: 조건문 수정
woowahan-cron Jul 2, 2024
b1ed5fb
refactor: 새로고침 가능여부 조건
woowahan-cron Jul 2, 2024
989ea2f
chore: 명칭 통일을 위해 파일 이름 수정(useMissionJudgement -> useMissionJudgment)
woowahan-cron Jul 3, 2024
a8041dd
test: useRefresh 훅 테스트
woowahan-cron Jul 3, 2024
15eb864
test: useJudgment 훅 테스트
woowahan-cron Jul 3, 2024
a2e5ab5
test: useMission 훅 테스트
woowahan-cron Jul 3, 2024
0c1a2ad
refactor: useJudgment 코드 리뷰 반영하여 리팩터링
woowahan-cron Jul 8, 2024
c53dd81
refactor: useMission.test 코드 리뷰 반영하여 리팩터링
woowahan-cron Jul 8, 2024
4eeaa4b
refactor: useRefresh.test 코드 리팩터링
woowahan-cron Jul 8, 2024
6cafd49
refactor: 테스트 코드 리팩터링
woowahan-cron Jul 8, 2024
85349b1
refactor: useMission 훅 조건부 리팩터링
woowahan-cron Jul 8, 2024
680bd89
refactor: useRefresh 조건부 리팩터링
woowahan-cron Jul 9, 2024
407308a
refactor: useRefresh 헬퍼 함수 리팩터링
woowahan-cron Jul 9, 2024
101f1f8
refactor: 테스트 코드 공통 함수
woowahan-cron Jul 9, 2024
3d1048f
refactor: useJudgment 공통 함수 호출
woowahan-cron Jul 9, 2024
2221fdf
refactor: useMission 테스트 공통 함수 호출
woowahan-cron Jul 9, 2024
f01dfd7
refactor: useRefresh 테스트 공통 함수 호출
woowahan-cron Jul 9, 2024
a9fea3b
test: MyMissionItem 컴포넌트 테스트
woowahan-cron Jul 9, 2024
f38c0da
refactor: useMissionJudgment 개행 제거
woowahan-cron Jul 11, 2024
e8914a5
refactor: Button 컴포넌트 선언부 수정
woowahan-cron Jul 11, 2024
28a44c0
refactor: MissionDetail 컴포넌트 속성 수정 (관심사 분리 작업)
woowahan-cron Jul 11, 2024
24437bc
refactor: 하위 컴포넌트 계층 이동 (종속 관계)
woowahan-cron Jul 11, 2024
0a01049
refactor: MyApplicationItem module 스타일 일관성 맞추기 작업
woowahan-cron Jul 15, 2024
f1517c3
refactor: 응답 값 Judgment 추론
woowahan-cron Jul 15, 2024
bc9d6d7
refactor: 버튼 이름 상수화 작업
woowahan-cron Jul 15, 2024
20924fd
refactor: 판정 -> 채점 용어 수정 작업
woowahan-cron Jul 15, 2024
04bcc21
refactor: 테스트 명세 문구 수정
woowahan-cron Jul 15, 2024
b4277b4
refactor: useMission 의존성 분리 작업
woowahan-cron Jul 15, 2024
f84fe3a
test: useMission 훅 의존성 분리 작업 후 테스트 개선
woowahan-cron Jul 15, 2024
5e46853
refactor: MyMissionItem 컴포넌트 테스트
woowahan-cron Jul 16, 2024
c7213d2
refactor: useMission 훅 리팩터링
woowahan-cron Jul 24, 2024
acd9682
rename: hook 파일 이동
woowahan-cron Jul 24, 2024
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
5 changes: 4 additions & 1 deletion frontend/src/api/recruitments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import axios from "axios";
import {
Assignment,
AssignmentData,
Judgment,
Mission,
Recruitment,
RecruitmentItem,
Expand All @@ -24,6 +25,8 @@ export type FetchMyMissionJudgmentRequest = RequestWithToken<{
missionId: number;
}>;

export type FetchMyMissionJudgmentResponseData = Judgment;

export type FetchMyMissionsResponseData = Mission[];

export type FetchAssignmentRequest = RequestWithToken<{
Expand Down Expand Up @@ -73,7 +76,7 @@ export const fetchMyMissionJudgment = ({
missionId,
token,
}: FetchMyMissionJudgmentRequest) =>
axios.get(
axios.get<FetchMyMissionJudgmentResponseData>(
`/api/recruitments/${recruitmentId}/missions/${missionId}/judgments/judge-example`,
headers({ token })
);
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/@common/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const Button = ({
className,
variant = BUTTON_VARIANT.CONTAINED,
cancel = false,
disabled = false,
children,
...props
}: ButtonProps) => {
Expand All @@ -23,6 +24,7 @@ const Button = ({
className={classNames(className, styles[variant], styles.button, {
[styles.cancel]: cancel,
})}
disabled={disabled}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a: React.ButtonHTMLAttributes<HTMLButtonElement>가 이미 disabled를 포함하고 있는 것으로 알고 있는데요! 혹시 더 명시적으로 표현해주기 위한 수정 사항일까요? 🙂

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네넵! 버튼을 커스텀해서 사용하고 있어서 명시적으로 표현하기 위해서였는데 ButtonProps 선언부에서는 굳이 disabled 속성을 표기해 줄 필요가 없겠군요! 그 부분만 적용해서 반영해보겠습니다.

{...props}
>
{children}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { Recruitment, RecruitmentStatus } from "../../../../types/domains/recrui
import { PARAM, PATH } from "../../../constants/path";
import { formatDateTime } from "../../../utils/format/date";
import { generateQuery } from "../../../utils/route/query";
import ApplyButton from "../MyApplicationButtons/ApplyButton";
import styles from "../MyApplicationItem.module.css";
import RecruitmentDetail from "../RecruitmentDetail/RecruitmentDetail";
import { BUTTON_LABEL, RECRUITMENT_STATUS } from "./../../../constants/recruitment";
import Button from "../../@common/Button/Button";

type MyApplicationFormItemProps = {
recruitment: Recruitment;
Expand Down Expand Up @@ -68,19 +68,24 @@ const MyApplicationFormItem = ({ recruitment, submitted }: MyApplicationFormItem

return (
<div className={classNames(styles["content-box"])}>
<div className={styles["text-container"]}>
<RecruitmentDetail startDate={formattedStartDateTime} endDate={formattedEndDateTime}>
{recruitment.title}
</RecruitmentDetail>
<div className={styles["content-wrapper"]}>
<div className={styles["title-container"]}>
<RecruitmentDetail startDate={formattedStartDateTime} endDate={formattedEndDateTime}>
{recruitment.title}
</RecruitmentDetail>

<div className={styles["button-container"]}>
<ApplyButton
isButtonDisabled={isButtonDisabled}
onClick={() => {
routeToApplicationForm(recruitment);
}}
label={applyButtonLabel}
/>
<ul className={styles["title-button-list"]}>
<li>
<Button
disabled={isButtonDisabled}
onClick={() => {
routeToApplicationForm(recruitment);
}}
>
{applyButtonLabel}
</Button>
</li>
</ul>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c: 이후에 추가될 것을 대비한 ul일까용? 🙂

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 맞습니다! 바로 다음 이슈에서 과제 보기 버튼을 추가할 예정이에요 ㅎㅎ

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아하 해당 UI가 추가될 때 같이 추가해주면 더 좋을 것 같습니다 :) 이 PR에서 다루는 이슈에서는 필요하지 않을 요소인 것 같아서요~! 🙂

</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.divider {
border: 0.5px solid var(--gray-300);
}

.content-box {
position: relative;
display: flex;
Expand All @@ -11,29 +15,41 @@
border: 1px solid var(--gray-300);
}

.text-container {
.content-wrapper {
display: flex;
flex-direction: column;
gap: 0.875rem;
width: 100%;
}

.auto-judgment-detail-contour {
border: 0.5px solid var(--gray-300);
.title-container {
display: flex;
justify-content: space-between;
}

.title-text {
flex: 1;
}

.button-container {
position: absolute;
top: 1.25rem;
right: 1.5rem;
ul.title-button-list {
display: flex;
gap: 1rem;
}

ul.title-button-list > li:not(:last-child) {
margin-right: 0.4rem;
}

@media screen and (max-width: 800px) {
.button-container {
position: static;
gap: 0.4rem;
margin-left: auto;
.title-container {
flex-direction: column;
gap: 0.875rem;
}

ul.title-button-list > li {
flex: 1;
}

ul.title-button-list > li > button {
width: 100%;
}
}
Loading