Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Last active November 4, 2018 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save productioncoder/9c9db49f69494b5d612bb7eaef9a62ee to your computer and use it in GitHub Desktop.
Save productioncoder/9c9db49f69494b5d612bb7eaef9a62ee to your computer and use it in GitHub Desktop.
Youtube in React: VideoInfoBox show paragraphs
/* ... */
export class VideoInfoBox extends React.Component {
render() {
if (!this.props.video) {
return <div/>;
}
const descriptionParagraphs = this.getDescriptionParagraphs();
const {descriptionTextClass, buttonTitle} = this.getConfig();
return (
{/*...*/}
<div className="video-info">
<div className='channel-name'>Channel Name</div>
<div className='video-publication-date'>Thu 24, 2017</div>
</div>
<Button color='youtube'>91.5K Subscribe</Button>
<div className="video-description">
<div className={descriptionTextClass}>
{descriptionParagraphs}
</div>
<Button compact onClick={this.onToggleCollapseButtonClick}>{buttonTitle}</Button>
</div>
{/*...*/}
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment