ghost-portal/packages/ui-params/src/Param/Base.tsx
Jaco Greeff d93169e172
Rework Params & Params Vector (#581)
* Split Params into ui-params

* Fix Vector value detection/adding

* Update jest config
2019-01-10 15:48:07 +01:00

41 lines
991 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 { BareProps } from '@polkadot/ui-app/types';
import { Size } from '../types';
import React from 'react';
import { Labelled } from '@polkadot/ui-app/index';
import Bare from './Bare';
type Props = BareProps & {
children: React.ReactNode,
isDisabled?: boolean,
label?: string,
size?: Size,
withLabel?: boolean
};
export default class Base extends React.PureComponent<Props> {
render () {
const { children, className, isDisabled, label, size = 'medium', style, withLabel } = this.props;
return (
<Bare
className={className}
style={style}
>
<Labelled
className={isDisabled ? 'full' : size}
label={label}
withLabel={withLabel}
>
{children}
</Labelled>
</Bare>
);
}
}