ghost-portal/packages/ui-app/src/CopyButton.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

36 lines
910 B
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 { Button$Sizes } from './Button';
import type { BareProps } from './types';
import React from 'react';
import CopyToClipboard from 'react-copy-to-clipboard';
import Button from './Button';
type Props = BareProps & {
icon?: string,
isCircular?: boolean,
isPrimary?: boolean,
size?: Button$Sizes,
value?: mixed
}
export default function CopyButton ({ className, icon = 'copy', isCircular = true, isPrimary = true, size = 'tiny', style, value }: Props): React$Node {
return (
<CopyToClipboard text={value}>
<Button
className={className}
icon={icon}
isCircular={isCircular}
isPrimary={isPrimary}
size={size}
style={style}
/>
</CopyToClipboard>
);
}