Skip to content

Instantly share code, notes, and snippets.

@Kristian-Roopnarine
Created February 18, 2020 20:55
Show Gist options
  • Save Kristian-Roopnarine/b7df156b3ec9742c050eabe9733b375a to your computer and use it in GitHub Desktop.
Save Kristian-Roopnarine/b7df156b3ec9742c050eabe9733b375a to your computer and use it in GitHub Desktop.
const ProjectCard = (props) => {
const renderDemoButton = () => {
if (props.demo === ""){
return (
<button className="ui disabled button">
Demo
</button>
)
} else {
return (
<a href={props.demo} target="_blank">
<button className="ui button">
Demo
</button>
</a>
)
}
}
return (
<div className="card">
<div className= "image">
<img src={props.image} />
</div>
<div className="content">
<div className="header">
{props.name}
</div>
<div className="description">
<p>{props.description}</p>
</div>
</div>
<div className="extra content">
<a href={props.github} target="_blank">
<button className="ui button">
Code
</button>
</a>
{renderDemoButton()}
</div>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment