forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFlickrImage.js
More file actions
37 lines (30 loc) · 823 Bytes
/
Copy pathFlickrImage.js
File metadata and controls
37 lines (30 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react'
class FlickrImage extends React.Component {
constructor (props) {
super(props);
this.handleClick = this.handleClick.bind(this);
}
handleClick (event) {
this.props.selectImage(this.props.url);
}
render () {
const imageStyle = {
backgroundImage: `url(${this.props.url})`
};
return (
<a className="FlickrImage"
onClick={this.handleClick}
href="javascript:;"
ref="flickrImage">
<img className="FlickrImage__screenreader"
alt={this.props.searchTerm}
src={this.props.url}>
</img>
<div className="FlickrImage__display"
style={imageStyle}>
</div>
</a>
);
}
}
export default FlickrImage