ghost-portal/packages/ui-app/src/Output.js
Jaco Greeff 5f884c4b65
Add utility/toolbox app (#51)
* Upgrades

* Add & use Output component

* Render app in content

* Use update @polkadot/dev-react

* Add app-toolbox

* DRY className concat

* Hashing in place

* Verify signature operational

* Entry updates

* Verification operational

* Final cleanups before PR

* Bump version
2018-05-15 16:58:32 +02:00

48 lines
1.1 KiB
JavaScript

// Copyright 2017-2018 Jaco Greeff
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
// @flow
import type { BareProps } from './types';
import React from 'react';
import CopyButton from './CopyButton';
import Labelled from './Labelled';
type Props = BareProps & {
children?: React$Node,
isHidden?: boolean,
label?: React$Node,
value?: mixed,
withCopy?: boolean,
withLabel?: boolean
};
export default function Output ({ className, children, isHidden, label, style, value, withCopy = false, withLabel }: Props): React$Node {
return (
<Labelled
className={className}
isHidden={isHidden}
label={label}
style={style}
withLabel={withLabel}
>
<div className='ui--output'>
{
// flowlint-next-line unclear-type:off
((value: any): React$Node)
}
{children}
{
withCopy
? (
<CopyButton className='ui--output-button' value={value} />
)
: null
}
</div>
</Labelled>
);
}