import { Callout, Checkbox, FormGroup } from '@blueprintjs/core'; import { observer } from 'mobx-react'; import * as React from 'react'; import { BlockableAccelerator } from '../../interfaces'; import { AppState } from '../state'; interface BlockAcceleratorsSettingsProps { appState: AppState; } /** * Settings content to block keyboard accelerators. * * @class BlockAcceleratorsSettings * @extends {React.Component} */ @observer export class BlockAcceleratorsSettings extends React.Component { constructor(props: BlockAcceleratorsSettingsProps) { super(props); this.handleBlockAcceleratorChange = this.handleBlockAcceleratorChange.bind( this, ); } /** * Handles a change on whether a keyboard shortcut should be blocked * before fiddle is executed. * * @param {React.ChangeEvent} event */ public handleBlockAcceleratorChange( event: React.FormEvent, ) { const { checked, value } = event.currentTarget; if (checked) { this.props.appState.addAcceleratorToBlock(value as BlockableAccelerator); } else { this.props.appState.removeAcceleratorToBlock( value as BlockableAccelerator, ); } } public render() { const { acceleratorsToBlock } = this.props.appState; const blockAcceleratorsLabel = ` Any keyboard shortcuts checked below will be disabled.`.trim(); return (

Block Keyboard Shortcuts

); } }