Files
habitica/website/common/script/libs/shops-seasonal.config.js
Natalie L fd9d738cc6 chore(content): add winter wonderland items (#14407)
* chore(content): add winter wonderland items

* chore(typos): dates are hard

* fix(tz): how far back we have fallen

* fix(event): four extra hours for stragglers

* fix(typo): singular snowball spell

* fix(gear): remove stray incorrect event prop

* merge release

* Revert "merge release"

This reverts commit 83e29d0288.

* feat(content): add EN text

* fix(dates): 2022-2023 Winter

* chore(content): add featured quest bundle

* fix(event): delay Snowballs, add quests to Seasonal Shop

Co-authored-by: Sabe Jones <sabrecat@gmail.com>
Co-authored-by: SabreCat <sabe@habitica.com>
2022-12-19 15:53:52 -06:00

54 lines
1.3 KiB
JavaScript

import find from 'lodash/find';
import upperFirst from 'lodash/upperFirst';
import moment from 'moment';
import {
EVENTS,
SEASONAL_SETS,
} from '../content/constants';
const CURRENT_EVENT = find(
EVENTS, event => moment().isBetween(event.start, event.end) && Boolean(event.season),
);
const SHOP_OPEN = CURRENT_EVENT && ['winter', 'spring', 'summer', 'fall'].includes(CURRENT_EVENT.season);
export default {
opened: SHOP_OPEN,
currentSeason: SHOP_OPEN ? upperFirst(CURRENT_EVENT.season) : 'Closed',
dateRange: {
start: CURRENT_EVENT ? moment(CURRENT_EVENT.start) : moment().subtract(1, 'days').toDate(),
end: CURRENT_EVENT ? moment(CURRENT_EVENT.end) : moment().subtract(1, 'seconds').toDate(),
},
availableSets: SHOP_OPEN
? [
...SEASONAL_SETS[CURRENT_EVENT.season],
]
: [],
pinnedSets: SHOP_OPEN
? {
rogue: 'winter2023RibbonRogueSet',
warrior: 'winter2023WalrusWarriorSet',
wizard: 'winter2023FairyLightsMageSet',
healer: 'winter2023CardinalHealerSet',
}
: {},
availableSpells: SHOP_OPEN && moment().isBetween('2022-12-27T08:00-05:00', CURRENT_EVENT.end)
? [
'snowball',
]
: [],
availableQuests: SHOP_OPEN && CURRENT_EVENT.season === 'winter'
? [
'evilsanta',
'evilsanta2',
]
: [],
featuredSet: 'winter2022PomegranateMageSet',
};