framework/js/old/common/components/GroupBadge.js

17 lines
446 B
JavaScript
Raw Normal View History

import Badge from './Badge';
export default class GroupBadge extends Badge {
static initProps(props) {
super.initProps(props);
if (props.group) {
props.icon = props.group.icon();
2020-04-17 17:57:55 +08:00
props.style = { backgroundColor: props.group.color() };
props.label = typeof props.label === 'undefined' ? props.group.nameSingular() : props.label;
props.type = 'group--' + props.group.id();
delete props.group;
}
}
}