From fcf2dd7254a1c0b91790b76a538b016a84984e56 Mon Sep 17 00:00:00 2001 From: Jordan Moore Date: Tue, 7 Jun 2022 07:50:16 -0500 Subject: [PATCH] fix(UI): Remove 'CTRL + Enter' on CTA for mobile (#46239) Co-authored-by: ahmad abdolsaheb --- client/i18n/locales/english/translations.json | 1 + .../templates/Challenges/classic/lower-jaw.tsx | 7 ++++++- .../src/templates/Challenges/classic/show.tsx | 2 +- config/misc.js | 1 + .../integration/learn/challenges/multifile.js | 18 +++++++++++++++--- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/client/i18n/locales/english/translations.json b/client/i18n/locales/english/translations.json index 9d2554f365d..78926b20df1 100644 --- a/client/i18n/locales/english/translations.json +++ b/client/i18n/locales/english/translations.json @@ -51,6 +51,7 @@ "run": "Run", "run-test": "Run the Tests (Ctrl + Enter)", "check-code": "Check Your Code (Ctrl + Enter)", + "check-code-2": "Check Your Code", "reset": "Reset", "reset-code": "Reset All Code", "help": "Help", diff --git a/client/src/templates/Challenges/classic/lower-jaw.tsx b/client/src/templates/Challenges/classic/lower-jaw.tsx index 796a24368b1..16041845d5a 100644 --- a/client/src/templates/Challenges/classic/lower-jaw.tsx +++ b/client/src/templates/Challenges/classic/lower-jaw.tsx @@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next'; import Fail from '../../../assets/icons/fail'; import LightBulb from '../../../assets/icons/lightbulb'; import GreenPass from '../../../assets/icons/green-pass'; +import { MAX_MOBILE_WIDTH } from '../../../../../config/misc'; interface LowerJawProps { hint?: string; @@ -201,6 +202,8 @@ const LowerJaw = ({ ); }; + const showDesktopButton = window.innerWidth > MAX_MOBILE_WIDTH; + const renderButtons = () => { return ( <> @@ -212,7 +215,9 @@ const LowerJaw = ({ aria-hidden={testBtnariaHidden} onClick={tryToExecuteChallenge} > - {t('buttons.check-code')} + {showDesktopButton + ? t('buttons.check-code') + : t('buttons.check-code-2')}