Skip to content

Commit b7bca11

Browse files
author
Arinde Eniola
committed
few changes
1 parent 1b4b361 commit b7bca11

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

app/js/app.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ var EGiphy = React.createClass({
5656
})
5757
},
5858

59+
//handle giphy search request from the
60+
// search bar
5961
handleSubmit: function(refs) {
6062
var searchValue = React.findDOMNode(refs).value;
6163
if(/^\s*[A-Za-z]+(?:\s+[A-Za-z]+)*\s*$/.test(searchValue)) {
@@ -79,8 +81,10 @@ var EGiphy = React.createClass({
7981
var display;
8082
// Check if the is internet connection, if not show
8183
// error message, if connection load giphys
84+
// TODO: Make this dry during the next iteration
8285
if(this.state.connection) {
8386
// If no giphy is found, display message
87+
// TODO: remove this shit, it is not DRY!
8488
if(this.state.noGiphyFound) {
8589
display = (
8690
<div className="mdl-cell mdl-cell--12-col giphy-view">

app/js/components/Giphy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require('../../css/style.css');
44

55
var Giphy = React.createClass({
66

7-
copyLikeToCliboard: function() {
7+
copyLinkToCliboard: function() {
88
clipboard.writeText(this.props.src.original.url);
99
this.props.showSnackBar();
1010
},
@@ -14,7 +14,7 @@ var Giphy = React.createClass({
1414
return (
1515
<img
1616
src={this.props.src.fixed_height_downsampled.url}
17-
onClick={this.copyLikeToCliboard}
17+
onClick={this.copyLinkToCliboard}
1818
className="giphy-image"/>
1919
);
2020
}

app/js/components/GiphyView.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ var GiphyView = React.createClass({
2929
* else show giphys
3030
*/
3131
var gifs = [],
32-
showDiv
32+
showSpinner,
3333
self = this;
3434

3535
if(!this.props.giphys.length) {
36-
showDiv = ""
36+
showSpinner = ""
3737
}
3838
else {
39-
showDiv = "show-div"
39+
showSpinner = "show-div"
4040
gifs = this.props.giphys.map(function(gif, index) {
4141
return (
4242
<div className="grid-item" key={'giphy-' + index}>
@@ -46,7 +46,7 @@ var GiphyView = React.createClass({
4646
});
4747
}
4848

49-
//This is bad, find a better way!
49+
// TODO: This is bad, find a better way!
5050
setTimeout(function() {
5151
this.addMasonryLayout()
5252
}.bind(this), 500);
@@ -56,7 +56,7 @@ var GiphyView = React.createClass({
5656
<div className="help-text">
5757
<span>CLICK ON IMAGE TO COPY LINK TO CLIPBOARD</span>
5858
</div>
59-
<div className={"load8 " + showDiv}>
59+
<div className={"load8 " + showSpinner}>
6060
<div className="loader">Loading...</div>
6161
</div>
6262
<div className="grid">

app/js/stores/GiphyStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var GiphyStore = assign({}, EventEmitter.prototype, {
3939
AppDispatcher.register(function(action) {
4040

4141
switch(action.actionType) {
42-
//what the fuck is this!
42+
//what the fuck is this, make it dry!
4343
case "LOAD_TRENDING_GIPHYS":
4444
giphys = action.data;
4545
GiphyStore.emitLoadGiphys();

0 commit comments

Comments
 (0)