Created
August 19, 2019 21:27
-
-
Save jamesvidler/5b39ddea3d37b847a932f5acd453bbcb to your computer and use it in GitHub Desktop.
A sample React module powered by Agility CMS
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
import React, { Component } from 'react'; | |
import './ImageLink.css' | |
class ImageLink extends Component { | |
render() { | |
return ( | |
<section className="imagelink"> | |
<h3>{this.props.item.fields.title}</h3> | |
<a href={this.props.item.fields.linkURL.href} target={this.props.item.fields.linkURL.target}> | |
<div> | |
<img src={this.props.item.fields.image.url + '?w=300&h=300'} alt={this.props.item.fields.image.label} /> | |
</div> | |
<div>{this.props.item.fields.linkURL.text}</div> | |
</a> | |
</section> | |
); | |
} | |
} | |
export default ImageLink; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment