Skip to content

Commit

Permalink
Expose CopyButton properties (Joystream#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr authored May 12, 2018
1 parent 1108e96 commit 9eb671c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/ui-app/src/CopyButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@ import React from 'react';
import CopyToClipboard from 'react-copy-to-clipboard';
import Button from 'semantic-ui-react/dist/es/elements/Button';

type Button$Sizes = 'mini' | 'tiny' | 'small' | 'medium' | 'large' | 'big' | 'huge' | 'massive';

type Props = BareProps & {
icon?: string,
isPrimary?: boolean,
size?: Button$Sizes,
value?: string
}

export default function CopyButton ({ className, style, value }: Props): React$Node {
export default function CopyButton ({ className, icon = 'copy', isPrimary = true, size = 'tiny', style, value }: Props): React$Node {
return (
<CopyToClipboard text={value}>
<Button
className={className}
icon='copy'
primary
size='tiny'
icon={icon}
primary={isPrimary}
size={size}
style={style}
/>
</CopyToClipboard>
Expand Down

0 comments on commit 9eb671c

Please sign in to comment.