feat: show reset button after submitting the code once (#47126)

* feat: shows reset after checking code once

* fix: changed conditions to hide and show help button
pull/47160/head
Jagruti Tiwari 2022-08-04 19:43:34 +05:30 committed by GitHub
parent b1a0ecf6c6
commit 4e55be35bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

View File

@ -188,9 +188,9 @@ const LowerJaw = ({
const isAttemptsLargerThanTest =
attemptsNumber &&
testsLength &&
(attemptsNumber >= testsLength || attemptsNumber > 3);
(attemptsNumber >= testsLength || attemptsNumber >= 3);
if (isAttemptsLargerThanTest && !earliestAvailableCompletion)
if (isAttemptsLargerThanTest && !earliestAvailableCompletion) {
return (
<div>
<hr />
@ -206,6 +206,16 @@ const LowerJaw = ({
</button>
</div>
);
} else {
return (
<div>
<hr />
<button className='btn-block btn fade-in' onClick={openResetModal}>
{t('learn.editor-tabs.restart-step')}
</button>
</div>
);
}
};
const showDesktopButton = window.innerWidth > MAX_MOBILE_WIDTH;