Skip to content

Commit e6813ad

Browse files
Eric SimonsEric Simons
authored andcommitted
Fixed compose issue, profile page issue
1 parent 9ca1099 commit e6813ad

File tree

8 files changed

+17
-34
lines changed

8 files changed

+17
-34
lines changed

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
"dependencies": {
1010
"history": "^4.3.0",
1111
"marked": "^0.3.6",
12-
"react": "^15.3.2",
13-
"react-dom": "^15.3.2",
14-
"react-redux": "^4.4.5",
15-
"react-router": "^2.8.1",
12+
"prop-types": "^15.5.10",
13+
"react": "^15.5.0",
14+
"react-dom": "^15.5.0",
15+
"react-redux": "^4.4.8",
16+
"react-router": "^3.0.4",
1617
"redux": "^3.6.0",
18+
"redux-devtools-extension": "^2.13.2",
1719
"redux-logger": "^3.0.1",
1820
"superagent": "^2.3.0",
1921
"superagent-promise": "^1.1.0"

src/components/App.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import agent from '../agent';
22
import Header from './Header';
33
import React from 'react';
4+
import PropTypes from 'prop-types';
45
import { connect } from 'react-redux';
56
import { APP_LOAD, REDIRECT } from '../constants/actionTypes';
67

@@ -57,7 +58,7 @@ class App extends React.Component {
5758
}
5859

5960
App.contextTypes = {
60-
router: React.PropTypes.object.isRequired
61+
router: PropTypes.object.isRequired
6162
};
6263

6364
export default connect(mapStateToProps, mapDispatchToProps)(App);

src/components/Header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const LoggedInView = props => {
3636
<ul className="nav navbar-nav pull-xs-right">
3737

3838
<li className="nav-item">
39-
<Link to="" className="nav-link">
39+
<Link to="/" className="nav-link">
4040
Home
4141
</Link>
4242
</li>

src/components/ProfileFavorites.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import { Link } from 'react-router';
44
import agent from '../agent';
55
import { connect } from 'react-redux';
66
import {
7-
PROFILE_FAVORITES_PAGE_LOADED,
8-
PROFILE_FAVORITES_PAGE_UNLOADED
7+
PROFILE_PAGE_LOADED,
8+
PROFILE_PAGE_UNLOADED
99
} from '../constants/actionTypes';
1010

1111
const mapDispatchToProps = dispatch => ({
1212
onLoad: (pager, payload) =>
13-
dispatch({ type: PROFILE_FAVORITES_PAGE_LOADED, pager, payload }),
13+
dispatch({ type: PROFILE_PAGE_LOADED, pager, payload }),
1414
onUnload: () =>
15-
dispatch({ type: PROFILE_FAVORITES_PAGE_UNLOADED })
15+
dispatch({ type: PROFILE_PAGE_UNLOADED })
1616
});
1717

1818
class ProfileFavorites extends Profile {

src/constants/actionTypes.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ export const APPLY_TAG_FILTER = 'APPLY_TAG_FILTER';
1717
export const CHANGE_TAB = 'CHANGE_TAB';
1818
export const PROFILE_PAGE_LOADED = 'PROFILE_PAGE_LOADED';
1919
export const PROFILE_PAGE_UNLOADED = 'PROFILE_PAGE_UNLOADED';
20-
export const PROFILE_FAVORITES_PAGE_LOADED = 'PROFILE_FAVORITES_PAGE_LOADED';
21-
export const PROFILE_FAVORITES_PAGE_UNLOADED = 'PROFILE_FAVORITES_PAGE_UNLOADED';
2220
export const LOGIN = 'LOGIN';
2321
export const LOGOUT = 'LOGOUT';
2422
export const REGISTER = 'REGISTER';

src/reducer.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import common from './reducers/common';
66
import editor from './reducers/editor';
77
import home from './reducers/home';
88
import profile from './reducers/profile';
9-
import profileFavorites from './reducers/profileFavorites';
109
import settings from './reducers/settings';
1110

1211
export default combineReducers({
@@ -17,6 +16,5 @@ export default combineReducers({
1716
editor,
1817
home,
1918
profile,
20-
profileFavorites,
2119
settings
2220
});

src/reducers/profileFavorites.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/store.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { applyMiddleware, createStore, compose } from 'redux';
2-
import {createLogger} from 'redux-logger'
1+
import { applyMiddleware, createStore } from 'redux';
2+
import { createLogger } from 'redux-logger'
3+
import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly';
34
import { promiseMiddleware, localStorageMiddleware } from './middleware';
45
import reducer from './reducer';
56

@@ -12,6 +13,6 @@ const getMiddleware = () => {
1213
}
1314
}
1415

15-
const store = createStore(reducer, compose(getMiddleware(), window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()))
16+
const store = createStore(reducer, composeWithDevTools(getMiddleware()))
1617

1718
export default store;

0 commit comments

Comments
 (0)