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

[Feat] admin을 통해 등록된 placeholder 파싱하여 추가 #274

Merged
merged 3 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
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/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