-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] - better real world example of dynamic content in HEAD
- Loading branch information
1 parent
1e76fa1
commit 0d0d498
Showing
18 changed files
with
224 additions
and
136 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
24 changes: 24 additions & 0 deletions
24
src/redux/action_creators/index/index_page_action_creators.js
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,24 @@ | ||
export function indexPageLoading(state = {}) { | ||
return { | ||
type: 'INDEX_PAGE_LOADING', | ||
isLoading: true, | ||
state | ||
}; | ||
} | ||
|
||
export function indexPageLoaded(state = {}) { | ||
return { | ||
type: 'INDEX_PAGE_LOADED', | ||
isLoading: false, | ||
state | ||
}; | ||
} | ||
|
||
export function indexPageLoadError(state = {}, error) { | ||
return { | ||
type: 'INDEX_PAGE_ERROR', | ||
isLoading: false, | ||
state, | ||
error | ||
}; | ||
} |
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,19 @@ | ||
import P from 'bluebird'; | ||
import * as indexPageActions from '../../action_creators/index/index_page_action_creators'; | ||
import notFoundActionCreator from '../../action_creators/not_found_status_action_creator'; | ||
import log from '../../../services/logger_service'; | ||
|
||
export default function fetchIndexData(params, dispatch, state) { | ||
dispatch(indexPageActions.indexPageLoading()); | ||
return P.all([ | ||
// This is a static page, but if you needed data | ||
]) | ||
.then(function handleIndexPageDataLoaded() { | ||
dispatch(indexPageActions.indexPageLoaded()); | ||
}) | ||
.catch(function handleUserError(err) { | ||
log.error(err, 'Error in fetching repo detail page.'); | ||
dispatch(notFoundActionCreator(500, 'ERROR_STATUS')); | ||
dispatch(indexPageActions.indexPageLoadError(err, state)); | ||
}); | ||
} |
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
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,26 @@ | ||
export default function(state = {}, action) { | ||
const typeMap = { | ||
INDEX_PAGE_LOADING() { | ||
return { | ||
isLoading: true | ||
}; | ||
}, | ||
INDEX_PAGE_LOADED() { | ||
return { | ||
isLoading: false | ||
}; | ||
}, | ||
INDEX_PAGE_ERROR() { | ||
return { | ||
isLoading: false, | ||
error: action.error | ||
}; | ||
} | ||
}; | ||
|
||
if (typeMap[action.type]) { | ||
return typeMap[action.type](); | ||
} | ||
|
||
return state; | ||
} |
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
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
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,30 @@ | ||
import baseSeoUtil from './base_seo_util'; | ||
|
||
// eslint-disable-next-line no-unused-vars | ||
export default function(state, action) { | ||
const data = baseSeoUtil({ | ||
site: '', | ||
siteConf: {}, | ||
title: '', | ||
url: '', | ||
description: '', | ||
image: '', | ||
image_width: '', | ||
image_height: '', | ||
articleSection: '', | ||
extend: [ | ||
{ | ||
meta: [ | ||
/* | ||
{ | ||
property: 'article:published_time', | ||
content: articleDate | ||
} | ||
*/ | ||
] | ||
} | ||
] | ||
}); | ||
|
||
return data; | ||
} |
Oops, something went wrong.