feat(promo): G1G1 2021

Also refactors a number of places on web client to start using event 
list from world state instead of singular currentEvent
This commit is contained in:
SabreCat
2021-12-15 16:20:43 -06:00
parent a1cddcaf17
commit 391a9bd91b
9 changed files with 50 additions and 12 deletions
@@ -111,6 +111,7 @@
</style>
<script>
import find from 'lodash/find';
import { mapState } from '@/libs/store';
import SecondaryMenu from '@/components/secondaryMenu';
import gifts from '@/assets/svg/gifts-vertical.svg';
@@ -128,8 +129,11 @@ export default {
},
computed: {
...mapState({
currentEvent: 'worldState.data.currentEvent',
currentEventList: 'worldState.data.currentEventList',
}),
currentEvent () {
return find(this.currentEventList, event => Boolean(event.promo));
},
promo () {
if (!this.currentEvent || !this.currentEvent.promo) return 'none';
return this.currentEvent.promo;