-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat-fe: 공고 대시보드 제목 영역에 모집일자 및 상태 정보 추가 #802
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9066665
Create draft PR for #801
github-actions[bot] acdcba7
feat: 모집 상태를 표시하는 RecruitmentStatusFlag 컴포넌트 분리 및 구현
seongjinme d9315b5
feat: 대시보드에서 DashboardHeader 컴포넌트 분리 및 구현
seongjinme 0b060c4
feat: Dashboard 컴포넌트에 DashboardHeader 적용
seongjinme df1e438
fix: 대시보드 데이터의 Loading 상태에 따른 분기 처리 추가
seongjinme 23fa909
feat: 수정된 Process API 스펙 반영
seongjinme a3691b3
refactor: 공고 주소 및 이동 버튼 요소를 DashboardHeader 컴포넌트와 병합
seongjinme c8e9152
fix: DashboardHeader의 스토리북에 누락된 prop 추가
seongjinme e377110
Merge branch 'fe/develop' into fe-801-DA_HEADER_01
seongjinme b0bdf6d
fix: DashboardHeader 스토리북의 RouterLink 에러 수정
seongjinme c176a31
chore: 공고로 이동 버튼 스타일 및 위치 변경
llqqssttyy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
frontend/src/components/dashboard/DashboardHeader/DashboardHeader.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { withRouter } from 'storybook-addon-remix-react-router'; | ||
import DashboardHeader from '.'; | ||
|
||
const meta = { | ||
title: 'Organisms/Dashboard/DashboardHeader', | ||
component: DashboardHeader, | ||
parameters: { | ||
layout: 'centered', | ||
docs: { | ||
description: { | ||
component: '현재 공고의 대시보드 헤더를 표시하는 컴포넌트입니다.', | ||
}, | ||
}, | ||
}, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
title: { control: 'text' }, | ||
postUrl: { control: 'text' }, | ||
startDate: { control: 'date' }, | ||
endDate: { control: 'date' }, | ||
}, | ||
decorators: [ | ||
withRouter, | ||
(Story) => ( | ||
<div style={{ width: '720px' }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
} satisfies Meta<typeof DashboardHeader>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const DashboardHeaderDefault: Story = { | ||
args: { | ||
title: '우아한테크코스 7기 프론트엔드 모집', | ||
postUrl: 'https://www.cruru.kr', | ||
startDate: '2024-07-15T09:00:00Z', | ||
endDate: '2024-12-15T09:00:00Z', | ||
}, | ||
}; |
40 changes: 40 additions & 0 deletions
40
frontend/src/components/dashboard/DashboardHeader/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import formatDate from '@utils/formatDate'; | ||
import { HiOutlineCalendar } from 'react-icons/hi'; | ||
|
||
import OpenInNewTab from '@components/_common/atoms/OpenInNewTab'; | ||
import RecruitmentStatusFlag from '@components/recruitment/RecruitmentStatusFlag'; | ||
|
||
import S from './style'; | ||
|
||
interface DashboardHeaderProps { | ||
title: string; | ||
postUrl: string; | ||
startDate: string; | ||
endDate: string; | ||
} | ||
|
||
export default function DashboardHeader({ title, postUrl, startDate, endDate }: DashboardHeaderProps) { | ||
return ( | ||
<S.Wrapper> | ||
<S.TitleContainer> | ||
<S.Title> | ||
{title} | ||
<OpenInNewTab | ||
url={postUrl} | ||
title="공고로 이동" | ||
/> | ||
</S.Title> | ||
<S.RecruitmentStatusContainer> | ||
<S.RecruitmentPeriod> | ||
<HiOutlineCalendar style={{ strokeWidth: '0.25rem' }} /> | ||
{`${formatDate(startDate)} ~ ${formatDate(endDate)}`} | ||
</S.RecruitmentPeriod> | ||
<RecruitmentStatusFlag | ||
startDate={startDate} | ||
endDate={endDate} | ||
/> | ||
</S.RecruitmentStatusContainer> | ||
</S.TitleContainer> | ||
</S.Wrapper> | ||
); | ||
} |
57 changes: 57 additions & 0 deletions
57
frontend/src/components/dashboard/DashboardHeader/style.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
padding-bottom: 1.2rem; | ||
`; | ||
|
||
const TitleContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.8rem; | ||
`; | ||
|
||
const Title = styled.div` | ||
${({ theme }) => theme.typography.heading[700]} | ||
|
||
display: flex; | ||
align-items: baseline; | ||
gap: 1.2rem; | ||
`; | ||
|
||
const RecruitmentStatusContainer = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
gap: 1.6rem; | ||
`; | ||
|
||
const RecruitmentPeriod = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
gap: 0.6rem; | ||
|
||
${({ theme }) => theme.typography.heading[400]}; | ||
color: ${({ theme }) => theme.baseColors.grayscale[600]}; | ||
`; | ||
|
||
const PostLinkContainer = styled.div` | ||
display: flex; | ||
gap: 0.8rem; | ||
min-width: 30rem; | ||
height: fit-content; | ||
`; | ||
|
||
const S = { | ||
Wrapper, | ||
TitleContainer, | ||
Title, | ||
RecruitmentStatusContainer, | ||
RecruitmentPeriod, | ||
PostLinkContainer, | ||
}; | ||
|
||
export default S; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
frontend/src/components/recruitment/RecruitmentStatusFlag/RecruitmentStatusFlag.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import RecruitmentStatusFlag from '.'; | ||
|
||
const meta = { | ||
title: 'Organisms/Recruitment/RecruitmentStatusFlag', | ||
component: RecruitmentStatusFlag, | ||
parameters: { | ||
layout: 'centered', | ||
docs: { | ||
description: { | ||
component: '현재 공고의 모집 진행 상태를 표시하는 플래그 컴포넌트입니다.', | ||
}, | ||
}, | ||
}, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
startDate: { control: 'date' }, | ||
endDate: { control: 'date' }, | ||
}, | ||
} satisfies Meta<typeof RecruitmentStatusFlag>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const RecruitmentStatusFlagDefault: Story = { | ||
args: { | ||
startDate: '2024-07-15T09:00:00Z', | ||
endDate: '2024-12-15T09:00:00Z', | ||
}, | ||
}; |
20 changes: 20 additions & 0 deletions
20
frontend/src/components/recruitment/RecruitmentStatusFlag/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { RecruitmentStatusType } from '@customTypes/recruitment'; | ||
import { getTimeStatus } from '@utils/compareTime'; | ||
import S from './style'; | ||
|
||
interface RecruitmentStatusFlagProps { | ||
startDate: string; | ||
endDate: string; | ||
} | ||
|
||
const RECRUITMENT_STATUS: Record<RecruitmentStatusType, string> = { | ||
Pending: '모집 예정', | ||
Ongoing: '모집 진행 중', | ||
Closed: '모집 마감', | ||
}; | ||
|
||
export default function RecruitmentStatusFlag({ startDate, endDate }: RecruitmentStatusFlagProps) { | ||
const { status } = getTimeStatus({ startDate, endDate }); | ||
|
||
return <S.FlagContainer status={status}>{RECRUITMENT_STATUS[status]}</S.FlagContainer>; | ||
} |
38 changes: 38 additions & 0 deletions
38
frontend/src/components/recruitment/RecruitmentStatusFlag/style.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import styled from '@emotion/styled'; | ||
import { css } from '@emotion/react'; | ||
import { RecruitmentStatusType } from '@customTypes/recruitment'; | ||
|
||
const FlagContainer = styled.div<{ status: RecruitmentStatusType }>` | ||
width: fit-content; | ||
border-radius: 0.4rem; | ||
padding: 0.5rem 0.8rem; | ||
${({ theme }) => theme.typography.common.small}; | ||
|
||
${({ theme, status }) => { | ||
if (status === 'Pending') { | ||
return css` | ||
border: 1px solid ${theme.baseColors.bluescale[100]}; | ||
background: ${theme.baseColors.bluescale[50]}; | ||
color: ${theme.baseColors.bluescale[500]}; | ||
`; | ||
} | ||
if (status === 'Ongoing') { | ||
return css` | ||
border: 1px solid ${theme.baseColors.purplescale[100]}; | ||
background: ${theme.baseColors.purplescale[50]}; | ||
color: ${theme.baseColors.purplescale[500]}; | ||
`; | ||
} | ||
return css` | ||
border: 1px solid ${theme.baseColors.grayscale[300]}; | ||
background: ${theme.baseColors.grayscale[200]}; | ||
color: ${theme.baseColors.grayscale[700]}; | ||
`; | ||
}} | ||
`; | ||
|
||
const S = { | ||
FlagContainer, | ||
}; | ||
|
||
export default S; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
깔끔해졌네용👍