mirror of
https://github.com/flarum/framework.git
synced 2025-05-24 23:59:57 +08:00
Finish admin permissions page and clean up everything
This commit is contained in:
16
js/lib/components/GroupBadge.js
Normal file
16
js/lib/components/GroupBadge.js
Normal file
@ -0,0 +1,16 @@
|
||||
import Badge from 'flarum/components/Badge';
|
||||
|
||||
export default class GroupBadge extends Badge {
|
||||
static initProps(props) {
|
||||
super.initProps(props);
|
||||
|
||||
if (props.group) {
|
||||
props.icon = props.group.icon();
|
||||
props.style = {backgroundColor: props.group.color()};
|
||||
props.label = typeof props.label === 'undefined' ? props.group.nameSingular() : props.label;
|
||||
props.type = 'group--' + props.group.nameSingular();
|
||||
|
||||
delete props.group;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user