From bfeb62719f653f999320bef3d8ee538733bc3248 Mon Sep 17 00:00:00 2001 From: maxceem Date: Fri, 4 Dec 2020 12:45:25 +0200 Subject: [PATCH] fix: disable "launch active" when no legacy - additionally fixed PrimaryButton styles globally not only for legacy links ref issue #933 --- .../PrimaryButton/PrimaryButton.module.scss | 12 ++++++++++++ src/components/ChallengeEditor/index.js | 16 +++++++++++++--- .../LegacyLinks/LegacyLinks.module.scss | 15 --------------- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/components/Buttons/PrimaryButton/PrimaryButton.module.scss b/src/components/Buttons/PrimaryButton/PrimaryButton.module.scss index 08682483..b311d684 100644 --- a/src/components/Buttons/PrimaryButton/PrimaryButton.module.scss +++ b/src/components/Buttons/PrimaryButton/PrimaryButton.module.scss @@ -14,6 +14,18 @@ border: none; padding: 0 20px; + // don't underline if button is done as a link + &:hover { + text-decoration: none; + } + + // hide outline for buttons and links + &:focus, + &:active, + &:visited { + outline: none; + } + span { color: $white; } diff --git a/src/components/ChallengeEditor/index.js b/src/components/ChallengeEditor/index.js index 6607f025..3170656d 100644 --- a/src/components/ChallengeEditor/index.js +++ b/src/components/ChallengeEditor/index.js @@ -44,6 +44,7 @@ import AlertModal from '../Modal/AlertModal' import PhaseInput from '../PhaseInput' import LegacyLinks from '../LegacyLinks' import AssignedMemberField from './AssignedMember-Field' +import Tooltip from '../Tooltip' const theme = { container: styles.modalContainer @@ -1193,9 +1194,18 @@ class ChallengeEditor extends Component {
- { isDraft &&
- -
} + {isDraft && ( +
+ {challenge.legacyId ? ( + + ) : ( + + {/* Don't disable button for real inside tooltip, otherwise mouseEnter/Leave events work not good */} + + + )} +
+ )} } {!isLoading && isActive &&
{/*
diff --git a/src/components/LegacyLinks/LegacyLinks.module.scss b/src/components/LegacyLinks/LegacyLinks.module.scss index 6260feb6..a6f48d60 100644 --- a/src/components/LegacyLinks/LegacyLinks.module.scss +++ b/src/components/LegacyLinks/LegacyLinks.module.scss @@ -13,19 +13,4 @@ outline: none; white-space: nowrap; } - - a { - &:hover { - text-decoration: none; - } - &:focus, - &:active, - &:visited { - outline: none; - } - - button:focus { - outline: none; - } - } }