Files
habitica/website/client/src/mixins/inventoryUtils.js
T
Matteo Pagliazzi e0e9811ab6 lint common
2019-10-09 20:08:36 +02:00

28 lines
667 B
JavaScript

export default {
methods: {
getItemClass (type, itemKey) {
switch (type) {
case 'food':
case 'special':
return `Pet_Food_${itemKey}`;
case 'eggs':
return `Pet_Egg_${itemKey}`;
case 'hatchingPotions':
return `Pet_HatchingPotion_${itemKey}`;
default:
return '';
}
},
getItemName (type, item) {
switch (type) {
case 'eggs':
return this.$t('egg', { eggType: item.text() });
case 'hatchingPotions':
return this.$t('potion', { potionType: item.text() });
default:
return item.text();
}
},
},
};