Skip to content

Commit

Permalink
adding support for promoted content
Browse files Browse the repository at this point in the history
  • Loading branch information
bytemaster committed Aug 24, 2016
1 parent 51139d1 commit c2a719e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/ResolveRoute.js
Expand Up @@ -59,8 +59,8 @@ export default function resolveRoute(path)
if (match) {
return {page: 'Post', params: match.slice(1)};
}
match = path.match(/^\/(best|updated|hot|votes|responses|trending|trending30|cashout|created|recent|active)\/?$/)
|| path.match(/^\/(best|updated|hot|votes|responses|trending|trending30|cashout|created|recent|active)\/([\w\d-]+)\/?$/);
match = path.match(/^\/(best|updated|hot|votes|responses|trending|trending30|promoted|cashout|created|recent|active)\/?$/)
|| path.match(/^\/(best|updated|hot|votes|responses|trending|trending30|promoted|cashout|created|recent|active)\/([\w\d-]+)\/?$/);
if (match) {
return {page: 'PostsIndex', params: match.slice(1)};
}
Expand Down
2 changes: 1 addition & 1 deletion app/components/modules/Header.jsx
Expand Up @@ -58,13 +58,13 @@ class Header extends React.Component {
let topic_link = topic ? <Link to={`/${this.last_sort_order || 'trending'}/${topic}`}>{topic}</Link> : null;

const sort_orders = {
promoted: 'promoted',
hot: 'hot',
trending: 'trending',
trending30: 'trending (30 day)',
cashout: 'payout time',
created: 'new',
active: 'active',
responses: 'responses',
votes: 'popular' };
const sort_order_menu = Object.keys(sort_orders).filter(so => so !== sort_order).map(so => ({link: `/${so}/${topic}`, value: sort_orders[so]}));

Expand Down
7 changes: 7 additions & 0 deletions app/redux/FetchDataSaga.js
Expand Up @@ -76,6 +76,13 @@ export function* fetchData(action) {
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if (order === 'promoted') {
call_name = 'get_discussions_by_promoted';
args = [
{ tag: category,
limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author,
start_permlink: permlink}];
} else if( order === 'active' ) {
call_name = 'get_discussions_by_active';
args = [
Expand Down

0 comments on commit c2a719e

Please sign in to comment.