Last active
September 4, 2016 16:13
-
-
Save Nosmadas/033b2750bda558c3a14a07b173d1040b to your computer and use it in GitHub Desktop.
Stateless Component
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
const Repo = ({repo, owner}) => { | |
return <div className="Repo"> | |
<h3> | |
<Link to={`/${owner.login}/${repo.name}`}> | |
{repo.name} | |
</Link> | |
{' by '} | |
<Link to={`/${owner.login}`}> | |
{owner.login} | |
</Link> | |
</h3> | |
{repo.description && | |
<p>{repo.description}</p> | |
} | |
</div> | |
}; |
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
export default class Repo extends Component { | |
render() { | |
const { repo, owner } = this.props | |
const { login } = owner | |
const { name, description } = repo | |
return ( | |
<div className="Repo"> | |
<h3> | |
<Link to={`/${login}/${name}`}> | |
{name} | |
</Link> | |
{' by '} | |
<Link to={`/${login}`}> | |
{login} | |
</Link> | |
</h3> | |
{description && | |
<p>{description}</p> | |
} | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment