ghost-portal/packages/ui-params/src/Param/Hash.tsx
kwingram25 dc943d7cd6
Button/TxButton submit on enter (#1170)
* Button/TxButton submit on enter

* promise linting

* testing ref approach

* Add TxComponent to handle submit on enter

* remove accountNonce

* remove input ref

* remove TxButton constructor

* remove comment

* empty constructor

* linting

* bug with null ref

* linting
2019-05-22 18:08:58 +02:00

34 lines
910 B
TypeScript

// Copyright 2017-2019 @polkadot/ui-app authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Props } from '../types';
import React from 'react';
import BaseBytes from './BaseBytes';
export default class Hash extends React.PureComponent<Props> {
render () {
const { className, defaultValue, isDisabled, isError, label, name, onChange, onEnter, style, type, withLabel } = this.props;
return (
<BaseBytes
className={className}
defaultValue={defaultValue}
isDisabled={isDisabled}
isError={isError}
label={label}
length={32}
name={name}
onChange={onChange}
onEnter={onEnter}
size={isDisabled ? 'full' : 'large'}
style={style}
type={type}
withLabel={withLabel}
/>
);
}
}