disable everything if user has no permission to edit config

This commit is contained in:
Maren Süwer
2018-08-16 12:12:59 +02:00
parent fbc3b45831
commit 08328bb95f
17 changed files with 100 additions and 53 deletions

View File

@@ -4,7 +4,8 @@ import React from "react";
type Props = {
label?: string,
checked: boolean,
onChange?: boolean => void
onChange?: boolean => void,
disabled?: boolean
};
class Checkbox extends React.Component<Props> {
onCheckboxChange = (event: SyntheticInputEvent<HTMLInputElement>) => {
@@ -17,11 +18,12 @@ class Checkbox extends React.Component<Props> {
return (
<div className="field">
<div className="control">
<label className="checkbox">
<label className="checkbox" disabled={this.props.disabled}>
<input
type="checkbox"
checked={this.props.checked}
onChange={this.onCheckboxChange}
disabled={this.props.disabled}
/>
{this.props.label}
</label>