Skip to content

Commit

Permalink
Merge pull request gothinkster#53 from foopang/fix-warnings
Browse files Browse the repository at this point in the history
Fix warnings
  • Loading branch information
EricSimons authored May 3, 2017
2 parents 0a0c8f6 + 225f2d9 commit 16e498f
Show file tree
Hide file tree
Showing 27 changed files with 31 additions and 57 deletions.
2 changes: 0 additions & 2 deletions src/agent.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import superagentPromise from 'superagent-promise';
import _superagent from 'superagent';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Article/ArticleMeta.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const ArticleMeta = props => {
return (
<div className="article-meta">
<Link to={`@${article.author.username}`}>
<img src={article.author.image} />
<img src={article.author.image} alt={article.author.username} />
</Link>

<div className="info">
Expand Down
2 changes: 1 addition & 1 deletion src/components/Article/Comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Comment = props => {
<Link
to={`@${comment.author.username}`}
className="comment-author">
<img src={comment.author.image} className="comment-author-img" />
<img src={comment.author.image} className="comment-author-img" alt={comment.author.username} />
</Link>
&nbsp;
<Link
Expand Down
3 changes: 2 additions & 1 deletion src/components/Article/CommentInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class CommentInput extends React.Component {
<div className="card-footer">
<img
src={this.props.currentUser.image}
className="comment-author-img" />
className="comment-author-img"
alt={this.props.currentUser.username} />
<button
className="btn btn-sm btn-primary"
type="submit">
Expand Down
3 changes: 0 additions & 3 deletions src/components/Article/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
'use strict';

import ArticleMeta from './ArticleMeta';
import CommentContainer from './CommentContainer';
import { Link } from 'react-router';
import React from 'react';
import agent from '../../agent';
import { connect } from 'react-redux';
Expand Down
2 changes: 0 additions & 2 deletions src/components/ArticleList.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import ArticlePreview from './ArticlePreview';
import ListPagination from './ListPagination';
import React from 'react';
Expand Down
4 changes: 1 addition & 3 deletions src/components/ArticlePreview.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import React from 'react';
import { Link } from 'react-router';
import agent from '../agent';
Expand Down Expand Up @@ -39,7 +37,7 @@ const ArticlePreview = props => {
<div className="article-preview">
<div className="article-meta">
<Link to={`@${article.author.username}`}>
<img src={article.author.image} />
<img src={article.author.image} alt={article.author.username} />
</Link>

<div className="info">
Expand Down
2 changes: 0 additions & 2 deletions src/components/Editor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import ListErrors from './ListErrors';
import React from 'react';
import agent from '../agent';
Expand Down
4 changes: 1 addition & 3 deletions src/components/Header.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import React from 'react';
import { Link } from 'react-router';

Expand Down Expand Up @@ -59,7 +57,7 @@ const LoggedInView = props => {
<Link
to={`@${props.currentUser.username}`}
className="nav-link">
<img src={props.currentUser.image} className="user-pic" />
<img src={props.currentUser.image} className="user-pic" alt={props.currentUser.username} />
{props.currentUser.username}
</Link>
</li>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/MainView.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const mapStateToProps = state => ({
});

const mapDispatchToProps = dispatch => ({
onTabClick: (tab, pager, payload) => dispatch({ type: 'CHANGE_TAB', tab, pager, payload })
onTabClick: (tab, pager, payload) => dispatch({ type: CHANGE_TAB, tab, pager, payload })
});

const MainView = props => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ const mapStateToProps = state => ({

const mapDispatchToProps = dispatch => ({
onClickTag: (tag, pager, payload) =>
dispatch({ type: 'APPLY_TAG_FILTER', tag, pager, payload }),
dispatch({ type: APPLY_TAG_FILTER, tag, pager, payload }),
onLoad: (tab, pager, payload) =>
dispatch({ type: 'HOME_PAGE_LOADED', tab, pager, payload }),
dispatch({ type: HOME_PAGE_LOADED, tab, pager, payload }),
onUnload: () =>
dispatch({ type: HOME_PAGE_UNLOADED })
});
Expand Down
2 changes: 0 additions & 2 deletions src/components/ListErrors.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import React from 'react';

class ListErrors extends React.Component {
Expand Down
6 changes: 2 additions & 4 deletions src/components/Profile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import ArticleList from './ArticleList';
import React from 'react';
import { Link } from 'react-router';
Expand Down Expand Up @@ -127,7 +125,7 @@ class Profile extends React.Component {
<div className="row">
<div className="col-xs-12 col-md-10 offset-md-1">

<img src={profile.image} className="user-img" />
<img src={profile.image} className="user-img" alt={profile.username} />
<h4>{profile.username}</h4>
<p>{profile.bio}</p>

Expand Down Expand Up @@ -169,4 +167,4 @@ class Profile extends React.Component {
}

export default connect(mapStateToProps, mapDispatchToProps)(Profile);
export { Profile as Profile, mapStateToProps as mapStateToProps };
export { Profile, mapStateToProps };
4 changes: 1 addition & 3 deletions src/components/ProfileFavorites.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import { Profile, mapStateToProps } from './Profile';
import React from 'react';
import { Link } from 'react-router';
Expand All @@ -12,7 +10,7 @@ import {

const mapDispatchToProps = dispatch => ({
onLoad: (pager, payload) =>
dispatch({ type: 'PROFILE_FAVORITES_PAGE_LOADED', pager, payload }),
dispatch({ type: PROFILE_FAVORITES_PAGE_LOADED, pager, payload }),
onUnload: () =>
dispatch({ type: PROFILE_FAVORITES_PAGE_UNLOADED })
});
Expand Down
2 changes: 0 additions & 2 deletions src/components/Settings.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import ListErrors from './ListErrors';
import React from 'react';
import { Link } from 'react-router';
import agent from '../agent';
import { connect } from 'react-redux';
import store from '../store';
import {
SETTINGS_SAVED,
SETTINGS_PAGE_UNLOADED,
Expand Down
5 changes: 0 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
'use strict';

import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import React from 'react';
import { Router, Route, IndexRoute, hashHistory } from 'react-router';
import agent from './agent';
import history from 'history';
import store from './store';

import App from './components/App';
import Article from './components/Article';
import Editor from './components/Editor';
import Header from './components/Header';
import Home from './components/Home';
import Login from './components/Login';
import Profile from './components/Profile';
Expand Down
2 changes: 0 additions & 2 deletions src/middleware.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import agent from './agent';
import {
ASYNC_START,
Expand Down
2 changes: 0 additions & 2 deletions src/reducer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import article from './reducers/article';
import articleList from './reducers/articleList';
import auth from './reducers/auth';
Expand Down
5 changes: 2 additions & 3 deletions src/reducers/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export default (state = {}, action) => {
article: action.payload[0].article,
comments: action.payload[1].comments
};
break;
case ARTICLE_PAGE_UNLOADED:
return {};
case ADD_COMMENT:
Expand All @@ -30,7 +29,7 @@ export default (state = {}, action) => {
...state,
comments: state.comments.filter(comment => comment.id !== commentId)
};
default:
return state;
}

return state;
};
4 changes: 2 additions & 2 deletions src/reducers/articleList.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default (state = {}, action) => {
case PROFILE_PAGE_UNLOADED:
case PROFILE_FAVORITES_PAGE_UNLOADED:
return {};
default:
return state;
}

return state;
};
4 changes: 3 additions & 1 deletion src/reducers/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ export default (state = {}, action) => {
case REGISTER_PAGE_UNLOADED:
return {};
case ASYNC_START:
if (action.subtype === 'LOGIN' || action.subtype === 'REGISTER') {
if (action.subtype === LOGIN || action.subtype === REGISTER) {
return { ...state, inProgress: true };
}
break;
case UPDATE_FIELD_AUTH:
return { ...state, [action.key]: action.value };
default:
return state;
}

return state;
Expand Down
4 changes: 2 additions & 2 deletions src/reducers/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default (state = defaultState, action) => {
case LOGIN_PAGE_UNLOADED:
case REGISTER_PAGE_UNLOADED:
return { ...state, viewChangeCounter: state.viewChangeCounter + 1 };
default:
return state;
}

return state;
};
2 changes: 2 additions & 0 deletions src/reducers/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export default (state = {}, action) => {
};
case UPDATE_FIELD_EDITOR:
return { ...state, [action.key]: action.value };
default:
return state;
}

return state;
Expand Down
4 changes: 2 additions & 2 deletions src/reducers/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default (state = {}, action) => {
};
case HOME_PAGE_UNLOADED:
return {};
default:
return state;
}

return state;
};
4 changes: 2 additions & 2 deletions src/reducers/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default (state = {}, action) => {
return {
...action.payload.profile
};
default:
return state;
}

return state;
};
4 changes: 2 additions & 2 deletions src/reducers/profileFavorites.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default (state = {}, action) => {
};
case PROFILE_FAVORITES_PAGE_UNLOADED:
return {};
default:
return state;
}

return state;
};
4 changes: 2 additions & 2 deletions src/reducers/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default (state = {}, action) => {
...state,
inProgress: true
};
default:
return state;
}

return state;
};

0 comments on commit 16e498f

Please sign in to comment.