fix: Updated design of api tokens to clarify, closes #3422

This commit is contained in:
Tom Moor
2022-04-25 21:34:18 -07:00
parent e49897ab5a
commit 2a11a23d5b
5 changed files with 91 additions and 15 deletions

View File

@@ -5,7 +5,7 @@ type Props = {
text: string;
children?: React.ReactElement;
onClick?: React.MouseEventHandler<HTMLButtonElement>;
onCopy: () => void;
onCopy?: () => void;
};
class CopyToClipboard extends React.PureComponent<Props> {
@@ -17,9 +17,8 @@ class CopyToClipboard extends React.PureComponent<Props> {
debug: process.env.NODE_ENV !== "production",
format: "text/plain",
});
if (onCopy) {
onCopy();
}
onCopy?.();
if (elem && elem.props && typeof elem.props.onClick === "function") {
elem.props.onClick(ev);