fix: render editor tabs if SHOW_UPCOMING_CHANGES is 'true' (#39513)

pull/39553/head
Ahmad Abdolsaheb 2020-09-04 22:29:29 +03:00 committed by Mrugesh Mohapatra
parent 06da30e48a
commit 9b1077acf5
2 changed files with 10 additions and 4 deletions

View File

@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
import { first } from 'lodash';
import EditorTabs from './EditorTabs';
import ActionRow from './ActionRow';
import { showUpcomingChanges } from '../../../../config/env.json';
const propTypes = {
challengeFiles: PropTypes.object,
@ -43,9 +44,10 @@ class DesktopLayout extends Component {
} = this.props;
const challengeFile = this.getChallengeFile();
return (
<Fragment>
{hasEditableBoundries && <ActionRow />}
{showUpcomingChanges && hasEditableBoundries && <ActionRow />}
<ReflexContainer className='desktop-layout' orientation='vertical'>
<ReflexElement flex={1} {...resizeProps}>
{instructions}
@ -57,7 +59,9 @@ class DesktopLayout extends Component {
<ReflexElement flex={1} {...reflexProps} {...resizeProps}>
{
<Fragment>
{!hasEditableBoundries && <EditorTabs />}
{showUpcomingChanges && !hasEditableBoundries && (
<EditorTabs />
)}
{editor}
</Fragment>
}

View File

@ -19,7 +19,8 @@ const {
ALGOLIA_APP_ID: algoliaAppId,
ALGOLIA_API_KEY: algoliaAPIKey,
PAYPAL_CLIENT_ID: paypalClientId,
DEPLOYMENT_ENV: deploymentEnv
DEPLOYMENT_ENV: deploymentEnv,
SHOW_UPCOMING_CHANGES: showUpcomingChanges
} = process.env;
const locations = {
@ -48,5 +49,6 @@ module.exports = Object.assign(locations, {
paypalClientId:
!paypalClientId || paypalClientId === 'id_from_paypal_dashboard'
? null
: paypalClientId
: paypalClientId,
showUpcomingChanges: showUpcomingChanges === 'true'
});