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] 파트 안내 메세지 추가 #270

Merged
merged 4 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
57 changes: 36 additions & 21 deletions src/views/ApplyPage/components/PartSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,22 @@ import SelectBox from '@components/Select';
import Textarea from '@components/Textarea';
import { Answers, Questions } from 'views/ApplyPage/types';

import { sectionContainer, title } from './style.css';
import { partInfo, partInfoWrapper, sectionContainer, title } from './style.css';
import FileInput from '../FileInput';
import LinkInput from '../LinkInput';

const PartInfo = ({ value }: { value: string }) => {
return (
<article className={partInfoWrapper}>
{value.split('\n').map((text) => (
<p className={partInfo} key={text}>
{text && <>&#183;</>} {text}
</p>
))}
</article>
);
};

interface PartSectionProps {
isReview: boolean;
refCallback: (elem: HTMLSelectElement) => void;
Expand Down Expand Up @@ -63,26 +75,29 @@ const PartSection = ({

return (
<div key={value}>
<Textarea
name={`part${id}`}
defaultValue={defaultValue}
maxCount={charLimit}
placeholder={
isFile
? '링크로 제출할 경우, 이곳에 작성해주세요. (파일로 제출한 경우에는 ‘파일 제출’이라고 기재 후 제출해주세요.)'
: ''
}
extraInput={
isFile ? (
<FileInput section="part" id={id} isReview={isReview} defaultFile={defaultFile} />
) : urls ? (
<LinkInput urls={urls} />
) : null
}
required
disabled={isReview}>
{value}
</Textarea>
{charLimit == null && <PartInfo value={value} />}
{charLimit != null && (
<Textarea
name={`part${id}`}
defaultValue={defaultValue}
maxCount={charLimit}
placeholder={
isFile
? '링크로 제출할 경우, 이곳에 작성해주세요. (파일로 제출한 경우에는 ‘파일 제출’이라고 기재 후 제출해주세요.)'
: ''
}
extraInput={
isFile ? (
<FileInput section="part" id={id} isReview={isReview} defaultFile={defaultFile} />
) : urls ? (
<LinkInput urls={urls} />
) : null
}
required
disabled={isReview}>
{value}
</Textarea>
)}
</div>
);
})}
Expand Down
14 changes: 14 additions & 0 deletions src/views/ApplyPage/components/PartSection/style.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,17 @@ export const title = style({
...theme.font.TITLE_2_28_SB,
color: theme.color.baseText,
});

export const partInfoWrapper = style({
display: 'flex',
flexDirection: 'column',
gap: 16,
margin: '20px 0 50px',
});

export const partInfo = style({
color: theme.color.lighterText,
...theme.font.BODY_1_18_M,
whiteSpace: 'pre-line',
letterSpacing: '-0.27px',
});