Skip to content

Commit

Permalink
Initializes SubmitBoxSeries
Browse files Browse the repository at this point in the history
  • Loading branch information
velopert committed Dec 30, 2018
1 parent a3d8c8a commit 9b2a61c
Show file tree
Hide file tree
Showing 11 changed files with 350 additions and 180 deletions.
87 changes: 50 additions & 37 deletions velog-frontend/src/components/write/SubmitBox/SubmitBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type Props = {
selectCategory: any,
inputTags: any,
configureThumbnail: Node,
configureSeries: Node,
visible: boolean,
isEdit: boolean,
onClose(): void,
Expand All @@ -22,6 +23,7 @@ type Props = {
onEditCategoryClick(): void,
onToggleAdditionalConfig(): void,
additional: Node | false,
series: Node | false,
postLink: ?string,
visibilitySelect: Node,
};
Expand Down Expand Up @@ -81,26 +83,32 @@ class SubmitBox extends Component<Props, State> {
postLink,
onTempSave,
visibilitySelect,
configureSeries,
series,
} = this.props;
const { animating } = this.state;

if (!visible && !animating) return null;
if (series) {
return <div className={cx('SubmitBox', visible ? 'appear' : 'disappear')}>{series}</div>;
}

return (
<div className={cx('SubmitBox', visible ? 'appear' : 'disappear')}>
<div className="title">
<div className="text">{isEdit ? '글 수정하기' : '새 글 작성하기'}</div>
{isEdit &&
postLink && (
<Link className="view" to={postLink}>
글 보기
</Link>
)}
</div>
{additional || (
<Fragment>
<div className="sections">
{/* <section>
<div className="wrapper">
<div className="title">
<div className="text">{isEdit ? '글 수정하기' : '새 글 작성하기'}</div>
{isEdit &&
postLink && (
<Link className="view" to={postLink}>
글 보기
</Link>
)}
</div>
{additional || (
<Fragment>
<div className="sections">
{/* <section>
<div className="section-title category" onClick={onEditCategoryClick}>
카테고리 선택
<div className="edit util flex-center">
Expand All @@ -110,33 +118,38 @@ class SubmitBox extends Component<Props, State> {
</div>
{selectCategory}
</section> */}
<section>
<div className="section-title">태그 설정</div>
{inputTags}
</section>
<section>
<div className="section-title">썸네일 지정</div>
{configureThumbnail}
</section>
</div>
<div className="footer">
<div className="buttons">
<button className="gray" onClick={onTempSave}>
임시저장
</button>
<button className={cx('purple', { blue: isEdit })} onClick={onSubmit}>
{isEdit ? '업데이트' : '작성하기'}
</button>
<section>
<div className="section-title">태그 설정</div>
{inputTags}
</section>
<section>
<div className="section-title">썸네일 지정</div>
{configureThumbnail}
</section>
<section>
<div className="section-title">시리즈 설정</div>
{configureSeries}
</section>
</div>
<div className="between">
<div className="visibility-select">{visibilitySelect}</div>
<div className="open-options">
<a onClick={onToggleAdditionalConfig}>추가설정</a>
<div className="footer">
<div className="buttons">
<button className="gray" onClick={onTempSave}>
임시저장
</button>
<button className={cx('purple', { blue: isEdit })} onClick={onSubmit}>
{isEdit ? '업데이트' : '작성하기'}
</button>
</div>
<div className="between">
<div className="visibility-select">{visibilitySelect}</div>
<div className="open-options">
<a onClick={onToggleAdditionalConfig}>추가설정</a>
</div>
</div>
</div>
</div>
</Fragment>
)}
</Fragment>
)}
</div>
</div>
);
}
Expand Down
Loading

0 comments on commit 9b2a61c

Please sign in to comment.