Skip to content

Commit

Permalink
[Feat] admin을 통해 등록된 placeholder 파싱하여 추가 (#274)
Browse files Browse the repository at this point in the history
* feat: placeholder 파싱하여 추가

* fix: placeholder 서버 데이터 사용 및 optional 활용
  • Loading branch information
lydiacho authored Jul 29, 2024
1 parent 1baa595 commit 8a586b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/views/ApplyPage/components/PartSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const PartSection = ({
required
disabled={isReview}
/>
{filteredQuestions?.map(({ value, charLimit, id, urls, isFile }) => {
{filteredQuestions?.map(({ value, charLimit, id, urls, isFile, placeholder, optional }) => {
const draftItem = partQuestionsById?.[id];
const defaultValue = draftItem ? draftItem.answer.answer : '';
const defaultFile = { id, file: draftItem?.answer.file, fileName: draftItem?.answer.fileName };
Expand All @@ -71,9 +71,10 @@ const PartSection = ({
defaultValue={defaultValue}
maxCount={charLimit}
placeholder={
isFile
placeholder ||
(isFile
? '링크로 제출할 경우, 이곳에 작성해주세요. (파일로 제출한 경우에는 ‘파일 제출’이라고 기재 후 제출해주세요.)'
: ''
: '')
}
extraInput={
isFile ? (
Expand All @@ -82,7 +83,7 @@ const PartSection = ({
<LinkInput urls={urls} />
) : null
}
required
required={!optional}
disabled={isReview}>
{value}
</Textarea>
Expand Down
2 changes: 2 additions & 0 deletions src/views/ApplyPage/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export interface Questions {
urls: string[];
charLimit: number;
isFile: boolean;
placeholder: string;
optional: boolean;
}

export interface QuestionsResponse {
Expand Down

0 comments on commit 8a586b4

Please sign in to comment.