Skip to content

Commit

Permalink
Merge pull request #151 from dailybruin/Breaking-Feeds
Browse files Browse the repository at this point in the history
Breaking feeds
  • Loading branch information
EdNawrocki authored Nov 5, 2024
2 parents 914bd3b + f74a890 commit d11c0ba
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions components/ArticleCard/Breaking.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ export default function Breaking(props) {
<div
css={css`
margin: 0 0 5px;
font-family: 'Roboto', serif;\n font-style: normal;\n font-weight: normal;\n font-size: 18px;\n color: #000000;\n\n p {\n margin: 0;\n }\n \n br {\n display: none;\n }\n
font-family: 'Roboto', serif;\n font-style: normal;\n font-weight: normal;\n font-size: 18px;\n color: #000000;\n\n
`}
dangerouslySetInnerHTML={{ __html: props.excerpt }}
dangerouslySetInnerHTML={{ __html: props.content }}
/>
</div>
{props.imageurl != "http://wp.dailybruin.com/images/2017/03/db-logo.png" &&
Expand Down
2 changes: 1 addition & 1 deletion components/ArticleCard/BreakingOverview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function BreakingOverview(props) {
<div
css={css`
margin: 10px 0 5px;
font-family: 'Roboto', serif;\n font-style: normal;\n font-weight: normal;\n font-size: 18px;\n color: #000000;\n\n p {\n margin: 0;\n }\n \n br {\n display: none;\n }\n
font-family: 'Roboto', serif;\n font-style: normal;\n font-weight: normal;\n font-size: 18px;\n color: #000000;\n\n
`}
dangerouslySetInnerHTML={{ __html: props.excerpt }}
/>
Expand Down
5 changes: 3 additions & 2 deletions layouts/Breaking/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,16 @@ export default class BreakingLayout extends React.Component {

getPosts(page) {
fetch(
`${Config.apiUrl}/wp-json/wp/v2/posts?_embed&categories=${this.props.categoryID}&tag=${this.props.tagID}&page=${page}`
`${Config.apiUrl}/wp-json/wp/v2/posts?_embed&categories=27179&tags=${this.props.tagID}&page=${page}` //27179 is the category ID of breaking feed posts
)
.then(response => response.json())
.then(
json => {
if (json.data == undefined && json.length != 0) {
console.log(`${Config.apiUrl}/wp-json/wp/v2/posts?_embed&categories=27179&tags=${this.props.tagID}&page=${page}`);
this.setState({
otherArticleCards: this.state.otherArticleCards.concat(
utilities.buildArticleList(json)
utilities.buildArticleList(json, "breaking")
)
});
} else {
Expand Down
1 change: 1 addition & 0 deletions layouts/utilities.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export function buildArticleCard(story, type = "") {
displayType={type}
headline={story.title != undefined ? story.title.rendered : ""}
excerpt={story.excerpt != undefined ? story.excerpt.rendered : ""}
content={ story.content != undefined ? story.content.rendered : ""} //currently sending all story content as a prop to all cards
href={`/post/[slug]`}
as={story.link}
link={story.link}
Expand Down

0 comments on commit d11c0ba

Please sign in to comment.