eschutho commented on a change in pull request #13630:
URL: https://github.com/apache/superset/pull/13630#discussion_r594658808



##########
File path: superset-frontend/src/SqlLab/components/ShareSqlLabQuery.tsx
##########
@@ -114,36 +115,33 @@ class ShareSqlLabQuery extends React.Component {
         </Button>
       </Styles>
     );
-  }
+  };
 
-  render() {
-    const canShare =
-      this.props.queryEditor.remoteId ||
-      isFeatureEnabled(FeatureFlag.SHARE_QUERIES_VIA_KV_STORE);
-    return (
-      <Tooltip
-        id="copy_link"
-        placement="top"
-        title={
-          canShare
-            ? t('Copy query link to your clipboard')
-            : t('Save the query to copy the link')
-        }
-      >
-        {canShare ? (
-          <CopyToClipboard
-            getText={callback => this.getCopyUrl(callback)}
-            wrapped={false}
-            copyNode={this.buildButton()}
-          />
-        ) : (
-          this.buildButton()
-        )}
-      </Tooltip>
-    );
-  }
-}
+  const canShare =
+    queryEditor.remoteId ||
+    isFeatureEnabled(FeatureFlag.SHARE_QUERIES_VIA_KV_STORE);
 
-ShareSqlLabQuery.propTypes = propTypes;
+  return (
+    <Tooltip
+      id="copy_link"
+      placement="top"
+      title={
+        canShare
+          ? t('Copy query link to your clipboard')
+          : t('Save the query to copy the link')
+      }
+    >
+      {canShare ? (
+        <CopyToClipboard
+          getText={(callback: any) => getCopyUrl(callback)}

Review comment:
       this was existing code, but since we're just passing the arg right on 
through, we should be able to just pass the function to the prop, like 
`getText={getCopyUrl}`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to