From 95d03296fa51dc216202d61a3334ceb6b15efe0f Mon Sep 17 00:00:00 2001 From: Gamebrary Date: Tue, 5 Apr 2022 18:55:36 -0700 Subject: [PATCH] wikipedia and stripe progress --- src/components/Game.vue | 62 +++++----------- src/components/Game/GameAlternativeTitles.vue | 62 ++++++++++++++++ src/components/Game/GameDescription.vue | 72 ++++++++----------- src/components/Game/GameDetails.vue | 44 ------------ src/components/PageHeader.vue | 2 +- src/pages/NotesPage.vue | 1 + src/pages/UpgradePage.vue | 46 +++++++++--- src/store/actions.js | 12 +--- src/styles/_typography.scss | 2 +- 9 files changed, 152 insertions(+), 151 deletions(-) create mode 100644 src/components/Game/GameAlternativeTitles.vue diff --git a/src/components/Game.vue b/src/components/Game.vue index b2b085ae..1ec45bd4 100644 --- a/src/components/Game.vue +++ b/src/components/Game.vue @@ -44,38 +44,25 @@ -

+

{{ game.name }} - Toggle Collapse - - - -
{{ game }}
- -
-
{{ game.steam.metacritic.score }} -
- - - - Also known as: -

+ + + + {{ name }} + + @@ -101,7 +88,7 @@ battle-royale --> - + @@ -113,19 +100,6 @@ class="d-md-none" /> - - {{ name }} - - @@ -159,6 +133,7 @@ import GameGenres from '@/components/Game/GameGenres'; // import GameNews from '@/components/Game/GameNews'; import GameDetails from '@/components/Game/GameDetails'; +import GameAlternativeTitles from '@/components/Game/GameAlternativeTitles'; import GamePlatforms from '@/components/Game/GamePlatforms'; import GameRating from '@/components/Game/GameRating'; import GameDescription from '@/components/Game/GameDescription'; @@ -174,6 +149,7 @@ export default { // Timeline, GameDescription, GameDetails, + GameAlternativeTitles, GamePlatforms, GameRating, // GameImages, diff --git a/src/components/Game/GameAlternativeTitles.vue b/src/components/Game/GameAlternativeTitles.vue new file mode 100644 index 00000000..b5ebdd96 --- /dev/null +++ b/src/components/Game/GameAlternativeTitles.vue @@ -0,0 +1,62 @@ + + + + + diff --git a/src/components/Game/GameDescription.vue b/src/components/Game/GameDescription.vue index b643e7b9..c7050545 100644 --- a/src/components/Game/GameDescription.vue +++ b/src/components/Game/GameDescription.vue @@ -9,54 +9,31 @@ - - - -

- + + + + diff --git a/src/components/PageHeader.vue b/src/components/PageHeader.vue index c492eb1c..0e827052 100644 --- a/src/components/PageHeader.vue +++ b/src/components/PageHeader.vue @@ -25,7 +25,7 @@

- + Upgrade diff --git a/src/pages/NotesPage.vue b/src/pages/NotesPage.vue index b2e55d2b..e2e51666 100644 --- a/src/pages/NotesPage.vue +++ b/src/pages/NotesPage.vue @@ -25,6 +25,7 @@ @@ -24,18 +29,39 @@ export default { data() { return { loading: false, - lineItems: [ - { - price: 'prod_LQ5kl5sCkdI7Kr', - quantity: 1, - }, - ], + planSelected: null, + monthlyPlan: { + price: 'price_1KjFY4GpsgtQXdlaWZa44Gbj', + quantity: 1, + }, + yearlyPlan: { + price: 'price_1KjFYeGpsgtQXdlajXFxtkDN', + quantity: 1, + }, }; }, + computed: { + lineItems() { + if (this.planSelected === 'monthly') return [this.monthlyPlan]; + if (this.planSelected === 'yearly') return [this.yearlyPlan]; + + return [{}]; + }, + }, + + watch: { + planSelected(value) { + this.$refs.checkoutRef.redirectToCheckout(); + }, + }, + methods: { // load(status) { - load() { + load(value) { + console.log(value); + this.loading = value; + console.log('load'); // console.log(status); }, }, diff --git a/src/store/actions.js b/src/store/actions.js index af74c1aa..b4e9ae0b 100644 --- a/src/store/actions.js +++ b/src/store/actions.js @@ -40,15 +40,9 @@ export default { LOAD_WIKIPEDIA_ARTICLE(context, articleTitle) { return new Promise((resolve, reject) => { - axios.get(`https://en.wikipedia.org/w/api.php?origin=*&action=query&prop=extracts&titles=${articleTitle}&format=json`) - .then(({ data: { query } }) => { - const pageIds = Object.keys(query.pages); - - const article = pageIds.length - ? query.pages[pageIds[0]] - : null; - - resolve(article); + axios.get(`https://en.wikipedia.org/api/rest_v1/page/mobile-sections/${articleTitle}`) + .then(({ data }) => { + resolve(data); }).catch(reject); }); }, diff --git a/src/styles/_typography.scss b/src/styles/_typography.scss index e85170a7..c20361af 100644 --- a/src/styles/_typography.scss +++ b/src/styles/_typography.scss @@ -84,6 +84,6 @@ $text-muted: $muted !default; // -$pre-color: $white !default; +$pre-color: $dark !default; // $pre-scrollable-max-height: 340px !default; //