mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add eslint rule padding-line-between-statements (#1593)
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
7b77f18376
commit
dcf253e7d5
401 files changed
+2018
-40
No files matched your search
@@ -40,8 +40,10 @@ export class Clipboard extends React.Component<CopyToClipboardProps> {
|
||||
}
|
||||
const { showNotification, resetSelection, getNotificationMessage, cssSelectorLimit } = this.props;
|
||||
const contentElem = this.rootElem.querySelector<any>(cssSelectorLimit) || this.rootElem;
|
||||
|
||||
if (contentElem) {
|
||||
const { copiedText, copied } = copyToClipboard(contentElem, { resetSelection });
|
||||
|
||||
if (copied && showNotification) {
|
||||
Notifications.ok(getNotificationMessage(copiedText));
|
||||
}
|
||||
@@ -51,12 +53,14 @@ export class Clipboard extends React.Component<CopyToClipboardProps> {
|
||||
render() {
|
||||
try {
|
||||
const rootElem = this.rootReactElem;
|
||||
|
||||
return React.cloneElement(rootElem, {
|
||||
className: cssNames(Clipboard.displayName, rootElem.props.className),
|
||||
onClick: this.onClick,
|
||||
});
|
||||
} catch (err) {
|
||||
logger.error(`Invalid usage components/CopyToClick usage. Children must contain root html element.`, { err: String(err) });
|
||||
|
||||
return this.rootReactElem;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user