2020-12-11 21:59:41 +00:00
|
|
|
import upperFirst from 'lodash/upperFirst';
|
|
|
|
|
import {
|
2024-02-01 14:06:32 +00:00
|
|
|
getCurrentGalaKey,
|
2020-12-11 21:59:41 +00:00
|
|
|
} from '../content/constants';
|
2024-02-01 14:06:32 +00:00
|
|
|
import {
|
|
|
|
|
armor,
|
|
|
|
|
} from '../content/gear/sets/special';
|
2017-09-21 00:28:11 +00:00
|
|
|
|
2024-05-15 09:56:40 +00:00
|
|
|
function getCurrentSeasonalSets (currentEvent) {
|
2024-02-01 14:06:32 +00:00
|
|
|
const year = new Date().getFullYear();
|
|
|
|
|
return {
|
2024-05-15 09:56:40 +00:00
|
|
|
rogue: armor[`${currentEvent}${year}Rogue`].set,
|
|
|
|
|
warrior: armor[`${currentEvent}${year}Warrior`].set,
|
|
|
|
|
wizard: armor[`${currentEvent}${year}Mage`].set,
|
|
|
|
|
healer: armor[`${currentEvent}${year}Healer`].set,
|
2024-02-01 14:06:32 +00:00
|
|
|
};
|
|
|
|
|
}
|
2020-12-10 22:53:37 +00:00
|
|
|
|
2024-05-15 09:56:40 +00:00
|
|
|
export default () => {
|
|
|
|
|
const currentEvent = getCurrentGalaKey();
|
2024-05-15 10:05:30 +00:00
|
|
|
const pinnedSets = getCurrentSeasonalSets(currentEvent)
|
2024-05-15 09:56:40 +00:00
|
|
|
return {
|
|
|
|
|
currentSeason: currentEvent ? upperFirst(currentEvent) : 'Closed',
|
2024-05-15 10:05:30 +00:00
|
|
|
pinnedSets,
|
|
|
|
|
featuredSet: user => {
|
|
|
|
|
if (user.stats.class) {
|
|
|
|
|
return pinnedSets[user.stats.class];
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
},
|
2024-05-15 09:56:40 +00:00
|
|
|
};
|
2017-09-21 00:28:11 +00:00
|
|
|
};
|