From 2320bd44d4b77f6acc11d7455802bef56bf9ec52 Mon Sep 17 00:00:00 2001 From: Yaozong Liu <750188453@qq.com> Date: Tue, 18 May 2021 07:20:03 +0800 Subject: [PATCH] fix(sqllab): fix error message (#14651) --- .../data/components/SyntaxHighlighterCopy/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/superset-frontend/src/views/CRUD/data/components/SyntaxHighlighterCopy/index.tsx b/superset-frontend/src/views/CRUD/data/components/SyntaxHighlighterCopy/index.tsx index d5b46d5a7f..f4eec7f0ca 100644 --- a/superset-frontend/src/views/CRUD/data/components/SyntaxHighlighterCopy/index.tsx +++ b/superset-frontend/src/views/CRUD/data/components/SyntaxHighlighterCopy/index.tsx @@ -36,11 +36,13 @@ SyntaxHighlighter.registerLanguage('json', jsonSyntax); const SyntaxHighlighterWrapper = styled.div` margin-top: -24px; + &:hover { svg { visibility: visible; } } + svg { position: relative; top: 40px; @@ -64,13 +66,13 @@ export default function SyntaxHighlighterCopy({ function copyToClipboard(textToCopy: string) { copyTextToClipboard(textToCopy) .then(() => { - if (addDangerToast) { - addDangerToast(t('Sorry, your browser does not support copying.')); + if (addSuccessToast) { + addSuccessToast(t('SQL Copied!')); } }) .catch(() => { - if (addSuccessToast) { - addSuccessToast(t('SQL Copied!')); + if (addDangerToast) { + addDangerToast(t('Sorry, your browser does not support copying.')); } }); }