mirror of
https://github.com/flarum/core.git
synced 2025-08-04 15:37:51 +02:00
Widget Cleanup
Removed unused Widget (which is duplicate of DashboardWidget), made DashboardWidget abstract
This commit is contained in:
committed by
David Sevilla Martín
parent
d83d082c4a
commit
968ece2c61
@@ -1,8 +1,8 @@
|
|||||||
import Component from '../../common/Component';
|
import Component from '../../common/Component';
|
||||||
|
|
||||||
export default class Widget extends Component {
|
export default abstract class DashboardWidget extends Component {
|
||||||
view() {
|
view() {
|
||||||
return <div className={'Widget ' + this.className()}>{this.content()}</div>;
|
return <div className={'DashboardWidget ' + this.className()}>{this.content()}</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,7 +19,5 @@ export default class Widget extends Component {
|
|||||||
*
|
*
|
||||||
* @return {VirtualElement}
|
* @return {VirtualElement}
|
||||||
*/
|
*/
|
||||||
content() {
|
abstract content(): JSX.Element
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,25 +0,0 @@
|
|||||||
import Component from '../../common/Component';
|
|
||||||
|
|
||||||
export default class DashboardWidget extends Component {
|
|
||||||
view() {
|
|
||||||
return <div className={'DashboardWidget ' + this.className()}>{this.content()}</div>;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the class name to apply to the widget.
|
|
||||||
*
|
|
||||||
* @return {String}
|
|
||||||
*/
|
|
||||||
className() {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the content of the widget.
|
|
||||||
*
|
|
||||||
* @return {VirtualElement}
|
|
||||||
*/
|
|
||||||
content() {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
@@ -11,7 +11,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.Widget {
|
.DashboardWidget {
|
||||||
background: @body-bg;
|
background: @body-bg;
|
||||||
color: @text-color;
|
color: @text-color;
|
||||||
border-radius: @border-radius;
|
border-radius: @border-radius;
|
||||||
|
Reference in New Issue
Block a user