Files
habitica/website/client/mixins/styleHelper.js
negue e4eca4b767 Challenges: infinite scroll (#11112)
* debounced infinite scroll on challenges

* add back the normal link color
2019-04-19 16:22:37 +02:00

19 lines
560 B
JavaScript

export default {
methods: {
userLevelStyle (user, style) {
style = style || '';
let npc = user && user.backer && user.backer.npc ? user.backer.npc : '';
let level = user && user.contributor && user.contributor.level ? user.contributor.level : '';
style += this.userLevelStyleFromLevel(level, npc, style);
return style;
},
userLevelStyleFromLevel (level, npc, style) {
style = style || '';
if (npc) style += ' npc';
style += level ? ` tier${level}` : ' no-tier';
return style;
},
},
};