forked from resource-watch/resource-watch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrates terms of service and how to pages
- Loading branch information
Showing
22 changed files
with
200 additions
and
256 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { connect } from 'react-redux'; | ||
|
||
// component | ||
import LayoutHowTo from './component'; | ||
|
||
export default connect( | ||
state => ({ data: state.staticPages['how-to'] }), | ||
null | ||
)(LayoutHowTo); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { connect } from 'react-redux'; | ||
|
||
import LayoutTermsOfService from './component'; | ||
|
||
export default connect( | ||
state => ({ data: state.staticPages['terms-of-service'] }), | ||
null | ||
)(LayoutTermsOfService); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import { handleModule } from 'redux-tools'; | ||
|
||
import dashboardsModule from './dashboards'; | ||
import staticPagesModules from './static-pages'; | ||
import topicsModule from './topics'; | ||
|
||
export default { | ||
dashboards: handleModule(dashboardsModule), | ||
staticPages: handleModule(staticPagesModules), | ||
topics: handleModule(topicsModule) | ||
}; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { createAction, createThunkAction } from 'redux-tools'; | ||
|
||
// service | ||
import { fetchStaticPage } from 'services/static-page'; | ||
|
||
// actions | ||
export const setContentPage = createAction('STATIC-PAGES__SET-CONTENT-PAGE'); | ||
export const setLoading = createAction('STATIC-PAGES__SET-LOADING'); | ||
export const setError = createAction('STATIC-PAGES__SET-ERROR'); | ||
|
||
export const getStaticPage = createThunkAction('STATIC-PAGES__GET-STATIC-PAGE', | ||
page => (dispatch) => { | ||
dispatch(setLoading({ key: page, value: true })); | ||
dispatch(setError(true)); | ||
|
||
return fetchStaticPage(page) | ||
.then((contentPage) => { | ||
dispatch(setContentPage({ key: page, value: contentPage })); | ||
dispatch(setLoading(false)); | ||
}) | ||
.catch((err) => { | ||
dispatch(setError(err)); | ||
dispatch(setLoading(false)); | ||
}); | ||
}); | ||
|
||
export default { | ||
setContentPage, | ||
setLoading, | ||
setError, | ||
getStaticPage | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import * as actions from './actions'; | ||
import * as reducers from './reducers'; | ||
import initialState from './initial-state'; | ||
|
||
export default { actions, reducers, initialState }; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export default { | ||
loading: true, | ||
error: null, | ||
about: {}, | ||
apps: {}, | ||
'contribute-data': {}, | ||
'develop-app': {}, | ||
getInvolved: {}, | ||
'how-to': {}, | ||
'join-community': {}, | ||
'submit-an-insight': {}, | ||
'terms-of-service': {}, | ||
topics: {} | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as actions from './actions'; | ||
|
||
export default { | ||
[actions.setContentPage]: (state, { payload }) => | ||
({ | ||
...state, | ||
[payload.key]: { | ||
...state[payload.key], | ||
...payload.value | ||
} | ||
}), | ||
|
||
[actions.setLoading]: (state, { payload }) => | ||
({ | ||
...state, | ||
loading: payload | ||
}), | ||
[actions.setError]: (state, { payload }) => | ||
({ | ||
...state, | ||
error: payload | ||
}) | ||
}; |
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.