diff --git a/client/src/templates/Challenges/backend/Show.js b/client/src/templates/Challenges/backend/Show.js
index 4ba1dd4ee3..91e5c26d7a 100644
--- a/client/src/templates/Challenges/backend/Show.js
+++ b/client/src/templates/Challenges/backend/Show.js
@@ -1,5 +1,6 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
+import { Grid, Col, Row } from '@freecodecamp/react-bootstrap';
import { createSelector } from 'reselect';
import { reduxForm } from 'redux-form';
import { graphql } from 'gatsby';
@@ -80,6 +81,12 @@ const options = {
};
export class BackEnd extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {};
+ this.updateDimensions = this.updateDimensions.bind(this);
+ }
+
componentDidMount() {
const {
initTests,
@@ -94,6 +101,15 @@ export class BackEnd extends Component {
} = this.props;
initTests(tests);
updateChallengeMeta({ ...challengeMeta, challengeType });
+ window.addEventListener('resize', this.updateDimensions);
+ }
+
+ updateDimensions() {
+ this.setState({ width: window.innerWidth, height: window.innerHeight });
+ }
+
+ componentWillUnmount() {
+ window.removeEventListener('resize', this.updateDimensions);
}
componentDidUpdate(prevProps) {
@@ -143,43 +159,50 @@ export class BackEnd extends Component {
const blockNameTitle = `${blockName} - ${title}`;
return (
-
-
- {blockNameTitle}
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
);
}
diff --git a/client/src/templates/Challenges/components/Challenge-Description.js b/client/src/templates/Challenges/components/Challenge-Description.js
index 3d0096a4c5..284a318c61 100644
--- a/client/src/templates/Challenges/components/Challenge-Description.js
+++ b/client/src/templates/Challenges/components/Challenge-Description.js
@@ -1,6 +1,5 @@
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
-import { Col, Row } from '@freecodecamp/react-bootstrap';
import './challenge-description.css';
@@ -12,20 +11,18 @@ const propTypes = {
function ChallengeDescription({ description, instructions, section }) {
return (
-
-
-
- {instructions ? (
-
-
-
-
-
- ) : (
+
+
+ {instructions ? (
+
- )}
-
-
+
+
+
+ ) : (
+
+ )}
+
);
}