Ensure CopyButton is not read-only (#3477)

This commit is contained in:
Jaco Greeff 2020-08-22 16:44:30 +02:00 committed by GitHub
parent d2282d2dba
commit dc6817d8af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,8 @@ interface Props {
value: string;
}
const NOOP = () => undefined;
function CopyButton ({ children, className, icon = 'copy', isAddress = false, value }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const { queueAction } = useContext(StatusContext);
@ -48,6 +50,7 @@ function CopyButton ({ children, className, icon = 'copy', isAddress = false, va
<Button
className='icon-button show-on-hover'
icon={icon}
onClick={NOOP}
/>
</span>
</div>
@ -57,12 +60,6 @@ function CopyButton ({ children, className, icon = 'copy', isAddress = false, va
}
export default React.memo(styled(CopyButton)`
cursor: copy;
button.u.ui--Icon.primary.button.icon-button {
cursor: copy;
}
.copySpan {
white-space: nowrap;
}