import './KeymapsForm.scss'; import React from 'react'; import Input from '../ui/Input'; import keymaps from '../../keymaps'; import { FormKeymaps } from '../../../shared/SettingData'; interface Props { value: FormKeymaps; onChange: (e: FormKeymaps) => void; onBlur: () => void; } class KeymapsForm extends React.Component { public static defaultProps: Props = { value: FormKeymaps.valueOf({}), onChange: () => {}, onBlur: () => {}, }; render() { let values = this.props.value.toJSON(); return
{ keymaps.fields.map((group, index) => { return
{ group.map(([name, label]) => { let value = values[name] || ''; return ; }) }
; }) }
; } bindValue(name: string, value: string) { this.props.onChange(this.props.value.buildWithOverride(name, value)); } } export default KeymapsForm;