Last active
February 1, 2018 18:32
-
-
Save MaximeHeckel/292990ec336ff6a802dab7f872c0b698 to your computer and use it in GitHub Desktop.
Medium - React “sub-components” - Article example 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyArticleView extends React.Component { | |
... | |
render() { | |
return ( | |
<div className={css.mainContainer}> | |
<div className={css.wrapper}> | |
<div className={css.titleContainer}> | |
<div className={css.title}> | |
<span>{this.renderTitle()}</span> | |
</div> | |
<div className={css.subtitle}> | |
<div className={css.subtitleBox}> {this.renderSubtitle()}</div> | |
</div> | |
</div> | |
<ul className={css.articlemetadata}> | |
<li className={css.item}>{this.renderAuthor()}</li> | |
<li className={css.item}>{this.renderDate()}</li> | |
</ul> | |
</div> | |
<div className={css.contentArticle}> | |
<div className={css.contentTextStyle}>{this.renderMainContent()}</div> | |
<span className={css.inlineComments}>{this.renderComments()}</span> | |
</div> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment