mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 23:23:52 +08:00
3f683dd6ee
* Replace gulp with webpack and npm scripts for JS compilation * Set up Travis CI to commit compiled JS * Restructure `js` directory; only one instance of npm, forum/admin are "submodules" * Refactor JS initializers into Application subclasses * Maintain partial compatibility API (importing from absolute paths) for extensions * Remove minification responsibility from PHP asset compiler * Restructure `less` directory
17 lines
444 B
JavaScript
17 lines
444 B
JavaScript
import Badge from './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.id();
|
|
|
|
delete props.group;
|
|
}
|
|
}
|
|
}
|