Fall Festival Gem Promo (#138)

* content: add gems blocks

* gemsBlocks: include ios and android identifiers

* wip: promo code

* split common constants into multiple files

* add second promo part

* geCurrentEvent, refactor promo

* fix lint

* fix exports, use world state api

* start adding world state tests

* remove console.log

* use gems block for purchases

* remove comments

* fix most unit tests

* restore comment

* fix lint

* prevent apple/google gift tests from breaking other tests when stub is not reset

* fix unit tests, clarify tests names

* iap: use gift object when gifting gems

* allow gift object with less data

* fix iap tests, remove findById stubs

* iap: require less data from the mobile apps

* apply discounts

* add missing worldState file

* fix lint

* add test event

* start removing 20 gems option for web

* start adding support for all gems packages on web

* fix unit tests for apple, stripe and google

* amazon: support all gems blocks

* paypal: support all gems blocks

* fix payments unit tests, add tests for getGemsBlock

* web: add gems plans with discounts, update stripe

* fix amazon and paypal clients, payments success modals

* amazon pay: disabled state

* update icons, start abstracting payments buttons

* begin redesign

* redesign gems modal

* fix buttons

* fix hover color for gems modal close icon

* add key to world state current event

* extend test event length

* implement gems modals designs

* early test fall2020

* fix header banner position

* add missing files

* use iso 8601 for dates, minor ui fixes

* fix time zones

* events: fix ISO8601 format

* fix css indentation

* start abstracting banners

* refactor payments buttons

* test spooky, fix group plans box

* implement gems promo banners, refactor banners, fixes

* fix lint

* fix dates

* remove unused i18n strings

* fix stripe integration test

* fix world state integration tests

* the current active event

* add missing unit tests

* add storybook story for payments buttons component

* fix typo

* fix(stripe): correct label when gifting subscriptions
This commit is contained in:
Matteo Pagliazzi
2020-09-21 16:22:13 +02:00
committed by GitHub
parent 82e6d544c8
commit 83aca20ce5
95 changed files with 1776 additions and 1099 deletions

View File

@@ -26,7 +26,6 @@
id="app"
:class="{
'casting-spell': castingSpell,
'resting': showRestingBanner
}"
>
<!-- <banned-account-modal /> -->
@@ -38,31 +37,8 @@
<router-view v-if="!isUserLoggedIn || isStaticPage" />
<template v-else>
<template v-if="isUserLoaded">
<div
v-show="showRestingBanner"
ref="restingBanner"
class="resting-banner"
>
<span class="content">
<span class="label d-inline d-sm-none">{{ $t('innCheckOutBannerShort') }}</span>
<span class="label d-none d-sm-inline">{{ $t('innCheckOutBanner') }}</span>
<span class="separator">|</span>
<span
class="resume"
@click="resumeDamage()"
>{{ $t('resumeDamage') }}</span>
</span>
<div
class="closepadding"
@click="hideBanner()"
>
<span
class="svg-icon inline icon-10"
aria-hidden="true"
v-html="icons.close"
></span>
</div>
</div>
<damage-paused-banner />
<gems-promo-banner />
<notifications-display />
<app-menu />
<div
@@ -99,20 +75,11 @@
<style lang='scss' scoped>
@import '~@/assets/scss/colors.scss';
@import '~@/assets/scss/variables.scss';
#app {
display: flex;
flex-direction: column;
overflow-x: hidden;
&.resting {
--banner-resting-height: #{$restingToolbarHeight};
}
&.giftingBanner {
--banner-gifting-height: 2.5rem;
}
}
#loading-screen-inapp {
@@ -143,15 +110,6 @@
cursor: crosshair;
}
.closepadding {
margin: 11px 24px;
display: inline-block;
position: relative;
right: 0;
top: 0;
cursor: pointer;
}
.container-fluid {
flex: 1 0 auto;
}
@@ -172,51 +130,11 @@
margin-top: .5em;
margin-bottom: .5em;
}
.resting-banner {
width: 100%;
height: $restingToolbarHeight;
background-color: $blue-10;
top: 0;
z-index: 1300;
display: flex;
.content {
line-height: 1.71;
text-align: center;
color: $white;
padding: 8px 38px 8px 8px;
margin: auto;
}
@media only screen and (max-width: 768px) {
.content {
font-size: 12px;
line-height: 1.4;
}
}
.separator {
color: $blue-100;
margin: 0px 15px;
}
.resume {
font-weight: bold;
cursor: pointer;
white-space:nowrap;
}
}
</style>
<style lang='scss'>
@import '~@/assets/scss/colors.scss';
.closepadding span svg path {
stroke: #FFF;
opacity: 0.48;
}
.modal-backdrop {
opacity: .9 !important;
background-color: $purple-100 !important;
@@ -234,6 +152,8 @@ import { loadProgressBar } from 'axios-progress-bar';
import AppMenu from './components/header/menu';
import AppHeader from './components/header/index';
import DamagePausedBanner from './components/header/banners/damagePaused';
import GemsPromoBanner from './components/header/banners/gemsPromo';
import AppFooter from './components/appFooter';
import notificationsDisplay from './components/notifications';
import snackbars from './components/snackbars/notifications';
@@ -255,8 +175,6 @@ import {
removeLocalSetting,
} from '@/libs/userlocalManager';
import svgClose from '@/assets/svg/close.svg';
const COMMUNITY_MANAGER_EMAIL = process.env.EMAILS_COMMUNITY_MANAGER_EMAIL; // eslint-disable-line
export default {
@@ -265,6 +183,8 @@ export default {
AppMenu,
AppHeader,
AppFooter,
DamagePausedBanner,
GemsPromoBanner,
notificationsDisplay,
snackbars,
BuyModal,
@@ -277,9 +197,6 @@ export default {
mixins: [notifications, spellsMixin],
data () {
return {
icons: Object.freeze({
close: svgClose,
}),
selectedItemToBuy: null,
selectedSpellToBuy: null,
@@ -299,9 +216,6 @@ export default {
castingSpell () {
return this.$store.state.spellOptions.castingSpell;
},
showRestingBanner () {
return !this.bannerHidden && this.user && this.user.preferences.sleep;
},
noMargin () {
return ['privateMessages'].includes(this.$route.name);
},
@@ -589,12 +503,6 @@ export default {
hideLoadingScreen () {
this.loading = false;
},
hideBanner () {
this.bannerHidden = true;
},
resumeDamage () {
this.$store.dispatch('user:sleep');
},
},
};
</script>