1
0
mirror of https://github.com/flarum/core.git synced 2025-08-15 12:54:47 +02:00

update: common/components/GroupBadge

This commit is contained in:
David Sevilla Martin
2020-08-08 15:42:44 -04:00
committed by Franz Liedke
parent 1616d8f1c7
commit 4af34265cc

View File

@@ -1,16 +1,16 @@
import Badge from './Badge'; import Badge from './Badge';
export default class GroupBadge extends Badge { export default class GroupBadge extends Badge {
static initProps(props) { initAttrs(attrs) {
super.initProps(props); super.initAttrs(attrs);
if (props.group) { if (attrs.group) {
props.icon = props.group.icon(); attrs.icon = attrs.group.icon();
props.style = { backgroundColor: props.group.color() }; attrs.style = { backgroundColor: attrs.group.color() };
props.label = typeof props.label === 'undefined' ? props.group.nameSingular() : props.label; attrs.label = typeof attrs.label === 'undefined' ? attrs.group.nameSingular() : attrs.label;
props.type = 'group--' + props.group.id(); attrs.type = 'group--' + attrs.group.id();
delete props.group; delete attrs.group;
} }
} }
} }