Files
habitica/website/common/script/libs/shops-seasonal.config.js
Natalie L f030135c82 chore(content): add 2022 Fall Festival (#14244)
* chore(submodule): add August 2022 Mystery Items

* update(content): add 2022 Fall Festival content

* update(content): add 2022 Fall Festival content

* update(content): update event dates for release

* fix(lint): remove extra spaces
also correct typo in gear string keys

* feat(content): remaining descriptions

* fix(event): correct spell availability

* fix(test): work around first-match logic

Co-authored-by: Sabe Jones <sabrecat@gmail.com>
Co-authored-by: SabreCat <sabe@habitica.com>
2022-09-19 16:55:53 -05:00

53 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
? {
healer: 'fall2022WatcherHealerSet',
rogue: 'fall2022KappaRogueSet',
warrior: 'fall2022OrcWarriorSet',
wizard: 'fall2022HarpyMageSet',
}
: {},
availableSpells: SHOP_OPEN && moment().isBetween('2022-10-04T08:00-05:00', CURRENT_EVENT.end)
? [
'spookySparkles',
]
: [],
availableQuests: SHOP_OPEN && CURRENT_EVENT.season === 'spring'
? [
'egg',
]
: [],
featuredSet: 'fall2021BrainEaterMageSet',
};