-
Notifications
You must be signed in to change notification settings - Fork 4
[feature] 모집 정보 수정 탭 모바일 화면을 추가한다 #2037
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
Open
suhyun113
wants to merge
3
commits into
develop-fe
Choose a base branch
from
feature/#2036-admin-mobile-recruit-edit-tab-MOA-1107
base: develop-fe
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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 hidden or 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
File renamed without changes.
File renamed without changes.
This file contains hidden or 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 hidden or 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
111 changes: 111 additions & 0 deletions
111
frontend/src/pages/AdminPage/tabs/RecruitEditTab/RecruitEditTabMobile.styles.ts
This file contains hidden or 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,111 @@ | ||
| import styled from 'styled-components'; | ||
| import { media } from '@/styles/mediaQuery'; | ||
| import { colors } from '@/styles/theme/colors'; | ||
| import { setTypography, typography } from '@/styles/theme/typography'; | ||
|
|
||
| export const MobileContainer = styled.div` | ||
| display: flex; | ||
| flex-direction: column; | ||
| padding-bottom: calc(80px + env(safe-area-inset-bottom) + 40px); | ||
| width: 100%; | ||
| max-width: 500px; | ||
| min-height: 100vh; | ||
| margin: 0 auto; | ||
| box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.04); | ||
|
|
||
| ${media.mobile} { | ||
| max-width: 100%; | ||
| margin: 0; | ||
| box-shadow: none; | ||
| } | ||
| `; | ||
|
|
||
| export const FormSection = styled.div` | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 30px; | ||
| padding: 32px 20px 0; | ||
| `; | ||
|
|
||
| export const PageTitle = styled.h2` | ||
| ${setTypography(typography.title.title5)} | ||
| color: ${colors.base.black}; | ||
| margin: 0; | ||
| `; | ||
|
|
||
| export const PageSubtitle = styled.p` | ||
| ${setTypography(typography.button.button1)} | ||
| color: ${colors.gray[700]}; | ||
| margin: -22px 0 0; | ||
| `; | ||
|
|
||
| export const FieldList = styled.div` | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 16px; | ||
| `; | ||
|
|
||
| export const PeriodSection = styled.div` | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 8px; | ||
| `; | ||
|
|
||
| export const SectionLabel = styled.span` | ||
| ${setTypography(typography.button.button1)} | ||
| color: ${colors.gray[900]}; | ||
| padding: 0 2px; | ||
| `; | ||
|
|
||
| export const DateTimeRow = styled.div` | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 8px; | ||
| `; | ||
|
|
||
| export const DateTimeInput = styled.input<{ $isDisabled?: boolean }>` | ||
| width: 100%; | ||
| height: 45px; | ||
| padding: 0 14px; | ||
| border: none; | ||
| border-radius: 12px; | ||
| background-color: ${({ $isDisabled }) => | ||
| $isDisabled ? colors.gray[400] : colors.gray[200]}; | ||
| color: ${({ $isDisabled }) => | ||
| $isDisabled ? colors.gray[500] : colors.gray[700]}; | ||
| font-size: 1rem; | ||
| pointer-events: ${({ $isDisabled }) => ($isDisabled ? 'none' : 'auto')}; | ||
|
|
||
| &::-webkit-calendar-picker-indicator { | ||
| ${({ $isDisabled }) => $isDisabled && `filter: invert(77%);`} | ||
| } | ||
| `; | ||
|
|
||
| export const AlwaysRecruitButton = styled.button<{ $isAlwaysActive: boolean }>` | ||
| align-self: flex-start; | ||
| border-radius: 10px; | ||
| padding: 0 18px; | ||
| height: 40px; | ||
| ${setTypography(typography.button.button1)} | ||
| cursor: pointer; | ||
|
|
||
| color: ${colors.gray[700]}; | ||
| background-color: ${colors.gray[300]}; | ||
| border: 1px solid ${colors.gray[400]}; | ||
|
|
||
| ${({ $isAlwaysActive }) => | ||
| $isAlwaysActive && | ||
| ` | ||
| color: ${colors.base.white}; | ||
| background-color: ${colors.primary[800]}; | ||
| border: none; | ||
| `} | ||
|
|
||
| transition: | ||
| background-color 0.12s ease, | ||
| transform 0.06s ease; | ||
|
|
||
| &:active { | ||
| transform: translateY(1px); | ||
| } | ||
| `; |
121 changes: 121 additions & 0 deletions
121
frontend/src/pages/AdminPage/tabs/RecruitEditTab/RecruitEditTabMobile.tsx
This file contains hidden or 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,121 @@ | ||
| import { useNavigate } from 'react-router-dom'; | ||
| import FixedBottomButtonArea from '@/components/common/FixedBottomButtonArea/FixedBottomButtonArea'; | ||
| import WebviewTopBar from '@/components/common/WebviewTopBar/WebviewTopBar'; | ||
| import { RECRUIT_TARGET_MAX } from '@/constants/adminFieldLimits'; | ||
| import ClearableTextArea from '@/pages/AdminPage/components/ClearableTextArea/ClearableTextArea'; | ||
| import InfoSection from '@/pages/AdminPage/components/InfoSection/InfoSection'; | ||
| import * as Styled from './RecruitEditTabMobile.styles'; | ||
|
|
||
| const toDateTimeLocalValue = (date: Date | null): string => { | ||
| if (!date) return ''; | ||
| const pad = (n: number) => String(n).padStart(2, '0'); | ||
| return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`; | ||
| }; | ||
|
|
||
| const fromDateTimeLocalValue = (value: string): Date | null => { | ||
| if (!value) return null; | ||
| return new Date(value); | ||
| }; | ||
|
|
||
| interface RecruitEditTabMobileProps { | ||
| recruitmentStart: Date | null; | ||
| recruitmentEnd: Date | null; | ||
| recruitmentTarget: string; | ||
| isAlwaysRecruiting: boolean; | ||
| isDirty: boolean; | ||
| onStartChange: (date: Date | null) => void; | ||
| onEndChange: (date: Date | null) => void; | ||
| onTargetChange: (value: string) => void; | ||
| onToggleAlwaysRecruiting: () => void; | ||
| onSave: () => void; | ||
| } | ||
|
|
||
| const RecruitEditTabMobile = ({ | ||
| recruitmentStart, | ||
| recruitmentEnd, | ||
| recruitmentTarget, | ||
| isAlwaysRecruiting, | ||
| isDirty, | ||
| onStartChange, | ||
| onEndChange, | ||
| onTargetChange, | ||
| onToggleAlwaysRecruiting, | ||
| onSave, | ||
| }: RecruitEditTabMobileProps) => { | ||
| const navigate = useNavigate(); | ||
|
|
||
| return ( | ||
| <> | ||
| <Styled.MobileContainer> | ||
| <WebviewTopBar | ||
| title='모집 정보 수정' | ||
| onBack={() => navigate('/admin')} | ||
| /> | ||
|
|
||
| <Styled.FormSection> | ||
| <Styled.PageTitle>모집 정보를 입력해주세요</Styled.PageTitle> | ||
| <Styled.PageSubtitle> | ||
| 해당 기간 동안 모집중 상태가 돼요 | ||
| </Styled.PageSubtitle> | ||
|
|
||
| <Styled.FieldList> | ||
| <Styled.PeriodSection> | ||
| <Styled.SectionLabel>모집 기간</Styled.SectionLabel> | ||
| <Styled.DateTimeRow> | ||
| <Styled.DateTimeInput | ||
| type='datetime-local' | ||
| aria-label='모집 시작 일시' | ||
| value={toDateTimeLocalValue(recruitmentStart)} | ||
| onChange={(e) => | ||
| onStartChange(fromDateTimeLocalValue(e.target.value)) | ||
| } | ||
| /> | ||
| <Styled.DateTimeInput | ||
| type='datetime-local' | ||
| aria-label='모집 종료 일시' | ||
| value={ | ||
| isAlwaysRecruiting | ||
| ? toDateTimeLocalValue(recruitmentStart) | ||
| : toDateTimeLocalValue(recruitmentEnd) | ||
| } | ||
| onChange={(e) => | ||
| onEndChange(fromDateTimeLocalValue(e.target.value)) | ||
| } | ||
| $isDisabled={isAlwaysRecruiting} | ||
| /> | ||
| </Styled.DateTimeRow> | ||
| <Styled.AlwaysRecruitButton | ||
| type='button' | ||
| $isAlwaysActive={isAlwaysRecruiting} | ||
| onClick={onToggleAlwaysRecruiting} | ||
| aria-pressed={isAlwaysRecruiting} | ||
| > | ||
| 상시모집 | ||
| </Styled.AlwaysRecruitButton> | ||
| </Styled.PeriodSection> | ||
|
|
||
| <InfoSection | ||
| label='모집 대상' | ||
| maxLength={RECRUIT_TARGET_MAX} | ||
| currentLength={recruitmentTarget.length} | ||
| > | ||
| <ClearableTextArea | ||
| value={recruitmentTarget} | ||
| onChange={onTargetChange} | ||
| onClear={() => onTargetChange('')} | ||
| placeholder='모집대상을 입력해주세요' | ||
| maxLength={RECRUIT_TARGET_MAX} | ||
| /> | ||
| </InfoSection> | ||
| </Styled.FieldList> | ||
| </Styled.FormSection> | ||
| </Styled.MobileContainer> | ||
|
|
||
| <FixedBottomButtonArea onClick={onSave} disabled={!isDirty}> | ||
| 저장하기 | ||
| </FixedBottomButtonArea> | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| export default RecruitEditTabMobile; | ||
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.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
종료 입력에 네이티브
disabled속성을 추가하세요.$isDisabled는 스타일 prop입니다. 현재pointer-events: none은 마우스 동작만 막습니다. 키보드 사용자는 종료 입력에 포커스하고 값을 변경할 수 있습니다.상시모집 상태에서는 화면에 시작일을 표시하지만 변경된
recruitmentEnd를 저장할 수 있습니다.disabled={isAlwaysRecruiting}를 전달하세요.수정 예시
<Styled.DateTimeInput type='datetime-local' aria-label='모집 종료 일시' + disabled={isAlwaysRecruiting} value={📝 Committable suggestion
🤖 Prompt for AI Agents