mirror of
https://github.com/flarum/core.git
synced 2025-06-25 12:14:13 +02:00
* Don't store checkbox states in NotificaitonGrid, use props for loading in Checkbox and Switch, replace preferenceSaver with internal management of loading state
18 lines
403 B
JavaScript
18 lines
403 B
JavaScript
import Checkbox from './Checkbox';
|
|
|
|
/**
|
|
* The `Switch` component is a `Checkbox`, but with a switch display instead of
|
|
* a tick/cross one.
|
|
*/
|
|
export default class Switch extends Checkbox {
|
|
static initProps(props) {
|
|
super.initProps(props);
|
|
|
|
props.className = (props.className || '') + ' Checkbox--switch';
|
|
}
|
|
|
|
getDisplay() {
|
|
return this.props.loading ? super.getDisplay() : '';
|
|
}
|
|
}
|