Skip to content
Snippets Groups Projects
Commit c2a719e2 authored by Daniel Larimer's avatar Daniel Larimer
Browse files

adding support for promoted content

parent 51139d15
No related branches found
No related tags found
No related merge requests found
...@@ -59,8 +59,8 @@ export default function resolveRoute(path) ...@@ -59,8 +59,8 @@ export default function resolveRoute(path)
if (match) { if (match) {
return {page: 'Post', params: match.slice(1)}; return {page: 'Post', params: match.slice(1)};
} }
match = path.match(/^\/(best|updated|hot|votes|responses|trending|trending30|cashout|created|recent|active)\/?$/) match = path.match(/^\/(best|updated|hot|votes|responses|trending|trending30|promoted|cashout|created|recent|active)\/?$/)
|| path.match(/^\/(best|updated|hot|votes|responses|trending|trending30|cashout|created|recent|active)\/([\w\d-]+)\/?$/); || path.match(/^\/(best|updated|hot|votes|responses|trending|trending30|promoted|cashout|created|recent|active)\/([\w\d-]+)\/?$/);
if (match) { if (match) {
return {page: 'PostsIndex', params: match.slice(1)}; return {page: 'PostsIndex', params: match.slice(1)};
} }
......
...@@ -58,13 +58,13 @@ class Header extends React.Component { ...@@ -58,13 +58,13 @@ class Header extends React.Component {
let topic_link = topic ? <Link to={`/${this.last_sort_order || 'trending'}/${topic}`}>{topic}</Link> : null; let topic_link = topic ? <Link to={`/${this.last_sort_order || 'trending'}/${topic}`}>{topic}</Link> : null;
const sort_orders = { const sort_orders = {
promoted: 'promoted',
hot: 'hot', hot: 'hot',
trending: 'trending', trending: 'trending',
trending30: 'trending (30 day)', trending30: 'trending (30 day)',
cashout: 'payout time', cashout: 'payout time',
created: 'new', created: 'new',
active: 'active', active: 'active',
responses: 'responses',
votes: 'popular' }; votes: 'popular' };
const sort_order_menu = Object.keys(sort_orders).filter(so => so !== sort_order).map(so => ({link: `/${so}/${topic}`, value: sort_orders[so]})); const sort_order_menu = Object.keys(sort_orders).filter(so => so !== sort_order).map(so => ({link: `/${so}/${topic}`, value: sort_orders[so]}));
......
...@@ -76,6 +76,13 @@ export function* fetchData(action) { ...@@ -76,6 +76,13 @@ export function* fetchData(action) {
limit: constants.FETCH_DATA_BATCH_SIZE, limit: constants.FETCH_DATA_BATCH_SIZE,
start_author: author, start_author: author,
start_permlink: permlink}]; 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' ) { } else if( order === 'active' ) {
call_name = 'get_discussions_by_active'; call_name = 'get_discussions_by_active';
args = [ args = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment