ghost-portal/packages/ui-app/src/InputExtrinsic/SelectSection.tsx
Jaco Greeff 864171e00a
Simplify i18n templates (#623)
* Start...

* Complete simplify i18n
2019-01-20 13:14:27 +01:00

46 lines
1.3 KiB
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 { MethodFunction } from '@polkadot/types/Method';
import { I18nProps } from '../types';
import { DropdownOptions } from '../util/types';
import React from 'react';
import Dropdown from '../Dropdown';
import classes from '../util/classes';
import translate from '../translate';
type Props = I18nProps & {
defaultValue?: string,
isError?: boolean,
label?: string,
onChange: (value: string) => void,
options: DropdownOptions,
value: MethodFunction,
withLabel?: boolean
};
class SelectSection extends React.PureComponent<Props> {
render () {
const { className, defaultValue, isError, label = '', onChange, options, style, t, value, withLabel } = this.props;
return (
<Dropdown
className={classes('ui--DropdownLinked-Sections', className)}
defaultValue={defaultValue}
isError={isError}
label={label || t('from extrinsic section')}
onChange={onChange}
options={options}
style={style}
value={value.section}
withLabel={withLabel}
/>
);
}
}
export default translate(SelectSection);