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

[Fix] 공통 문항에 placeholder, optional 적용 #277

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
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
9 changes: 5 additions & 4 deletions src/views/ApplyPage/components/CommonSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const CommonSection = ({ isReview, refCallback, questions, commonQuestionsDraft
return (
<section ref={refCallback} id="common" className={sectionContainer}>
<h2 className={title}>공통 질문</h2>
{questions?.map(({ urls, value, id, charLimit, isFile }) => {
{questions?.map(({ urls, value, id, charLimit, isFile, placeholder, optional }) => {
const draftItem = commonQuestionsById?.[id];
const defaultValue = draftItem ? draftItem.answer.answer : '';
const defaultFile = { id, file: draftItem?.answer.file, fileName: draftItem?.answer.fileName };
Expand All @@ -39,9 +39,10 @@ const CommonSection = ({ isReview, refCallback, questions, commonQuestionsDraft
defaultValue={defaultValue}
maxCount={charLimit}
placeholder={
isFile
placeholder ||
(isFile
? '링크로 제출할 경우, 이곳에 작성해주세요. (파일로 제출한 경우에는 ‘파일 제출’이라고 기재 후 제출해주세요.)'
: ''
: '')
}
extraInput={
isFile ? (
Expand All @@ -50,7 +51,7 @@ const CommonSection = ({ isReview, refCallback, questions, commonQuestionsDraft
<LinkInput urls={urls} />
) : null
}
required
required={!optional}
disabled={isReview}>
{value}
</Textarea>
Expand Down