Refactor and add doc level comments

This commit is contained in:
Ian Minoso 2016-11-29 15:57:53 -05:00
parent 0d915eccc4
commit daa759a066
4 changed files with 35 additions and 17 deletions

View file

@ -1,24 +1,32 @@
import * as React from "react";
interface IMain {
interface IBody {
description: string
}
class body extends React.Component<IMain, {}> {
/**
* The Component for the main body of the repo page
* @param {string} description - The description of the repository
*/
class body extends React.Component<IBody, {}> {
static propTypes = {
description: React.PropTypes.string.isRequired,
}
render () {
let description: string = this.props.description;
if (description === "") {
description = "No Description";
}
return(
<div>
<ul className="nav nav-tabs rp-tabs">
<li className="active"><a href="#tab1" data-toggle="tab">Description</a></li>
<li><a href="#tab2" data-toggle="tab">Automated Builds</a></li>
<li className="active"><a href="#tab1" data-toggle="tab">Description</a></li>
<li><a href="#tab2" data-toggle="tab">Automated Builds</a></li>
</ul>
<div className="panel-body rp-panelBody">
<div className="tab-content">
<div className="tab-pane in active" id="tab1">
<div className="rp-description">{this.props.description}</div>
<div className="rp-description">{description}</div>
</div>
<div className="tab-pane" id="tab2">
TODO (IAN): Convert the build directives to angular components