habitica/website/client/libs/notifications.js

33 lines
691 B
JavaScript
Raw Normal View History

2017-10-02 07:26:41 +00:00
export function getDropClass ({type, key}) {
2017-10-02 00:45:21 +00:00
let dropClass = '';
2017-10-02 07:26:41 +00:00
if (type) {
switch (type) {
2017-10-02 00:45:21 +00:00
case 'Egg':
2017-10-02 07:26:41 +00:00
dropClass = `Pet_Egg_${key}`;
2017-10-02 00:45:21 +00:00
break;
case 'HatchingPotion':
2017-10-02 07:26:41 +00:00
dropClass = `Pet_HatchingPotion_${key}`;
2017-10-02 00:45:21 +00:00
break;
case 'Food':
2017-10-02 07:26:41 +00:00
case 'food':
dropClass = `Pet_Food_${key}`;
2017-10-02 00:45:21 +00:00
break;
case 'armor':
case 'back':
case 'body':
case 'eyewear':
case 'head':
case 'headAccessory':
case 'shield':
case 'weapon':
2017-10-02 07:26:41 +00:00
case 'gear':
dropClass = `shop_${key}`;
2017-10-02 00:45:21 +00:00
break;
default:
dropClass = 'glyphicon glyphicon-gift';
}
}
2017-10-02 07:26:41 +00:00
2017-10-02 00:45:21 +00:00
return dropClass;
2017-10-02 07:26:41 +00:00
}