diff --git a/package.json b/package.json index 07ae59d8..7fd5bdd7 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "firebase-admin": "^9.2.0", "firebase-functions": "^3.11.0", "firebaseui": "^4.8.0", + "js-bbcode-parser": "^3.0.5", "lodash.chunk": "^4.2.0", "lodash.groupby": "^4.6.0", "lodash.orderby": "^4.6.0", diff --git a/src/components/Game.vue b/src/components/Game.vue index b477bfc8..33bcbdc0 100644 --- a/src/components/Game.vue +++ b/src/components/Game.vue @@ -45,6 +45,7 @@ class="my-1 w-25" /> + import GameNotes from '@/components/Game/GameNotes'; +import GameNews from '@/components/Game/GameNews'; import GameDetails from '@/components/Game/GameDetails'; import GameRating from '@/components/Game/GameRating'; import GameDescription from '@/components/Game/GameDescription'; @@ -111,6 +113,7 @@ export default { GameRating, GameImages, GameNotes, + GameNews, GameVideos, GameWebsites, SimilarGames, diff --git a/src/components/Game/GameNews.vue b/src/components/Game/GameNews.vue new file mode 100644 index 00000000..2e0eefe8 --- /dev/null +++ b/src/components/Game/GameNews.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/src/store/actions.js b/src/store/actions.js index 01a3774f..fb78c75f 100644 --- a/src/store/actions.js +++ b/src/store/actions.js @@ -32,6 +32,19 @@ export default { }); }, + LOAD_STEAM_GAME_NEWS(context, steamGameId) { + return new Promise((resolve, reject) => { + axios.get(`${API_BASE}/steam-news?appId=${steamGameId}`) + .then(({ data }) => { + const gameNews = data && data.appnews && data.appnews.newsitems + ? data.appnews.newsitems + : null; + + resolve(gameNews); + }).catch(reject); + }); + }, + LOAD_BOARDS({ state, commit }) { return new Promise((resolve, reject) => { const db = firebase.firestore();