Skip to content

Commit 7662bbe

Browse files
Dieu HuynhDieu Huynh
authored andcommitted
Merge branch 'master' into accessLens
2 parents 8c22646 + 14fb0fa commit 7662bbe

File tree

3 files changed

+54
-9
lines changed

3 files changed

+54
-9
lines changed

src/components/EditorView/EditorView.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ const Editor = () => {
2121
colorDecorators: true,
2222
wrappingIndent: 'indent',
2323
automaticLayout: true,
24+
codeLens: true,
25+
// Added specific fontfamily and fontsize to address Windows curson misalignment issue
26+
fontFamily: 'courier new',
27+
fontSize: 12,
2428
};
2529

2630
const editorDidMount = () => {
2731
editor.setTheme('light-dark');
28-
// editor.focus();
2932
};
3033

3134
const updatafile = (newValue, e) => {

src/components/Modals/ExportFileModal.module.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,12 @@ pre {
242242
flex: 1;
243243
flex-direction: column;
244244
padding: 12px 15px;
245-
margin-top: -4px;
245+
// margin-top: -4px;
246246
margin-bottom: 8px;
247247
overflow: auto;
248-
// width: 97.5%;
249248
font-size: 85%;
250249
line-height: 1.45;
251250
background-color: #0a1f40;
252251
color: white;
253-
// border-radius: 6px;
252+
254253
}

src/components/Modals/Modal.jsx

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,15 @@ const Modal = ({
142142
);
143143
}
144144

145-
145+
// EndPointGuide component definition, conditionally rendered
146146
const EndPointGuide = () => {
147147
// endpoint guide only exists when user is in endpoint testing
148148
if (script.endPointGuide) {
149149
const array = [];
150150
for (let step in script.endPointGuide) {
151151
array.push(<div id={styles.endPointGuide}>{script.endPointGuide[step]}{'\n'}</div>)
152-
}
153-
// return accordion element
152+
};
153+
// return accordion element
154154
return (
155155
<Accordion hidden={false}>
156156
<AccordionSummary
@@ -167,11 +167,52 @@ const Modal = ({
167167
</Accordion>
168168
);
169169
}
170-
171170
// return anything to not render accordion
172-
return true;
171+
return null;
173172
};
174173

174+
// ReactDependencies component definition, conditionally rendered
175+
const ReactDependencies = () => {
176+
if (title === 'hooks' || title === 'react') {
177+
return (
178+
<Accordion hidden={false}>
179+
<AccordionSummary
180+
expandIcon={<ExpandMoreIcon />}
181+
aria-controls="panel1a-content"
182+
id="panel1a-header"
183+
id={styles.accordionSummary}
184+
>
185+
3. Important React Babel Configuration
186+
</AccordionSummary>
187+
<AccordionDetails id={styles.configGuide}>
188+
<div id={styles.accordionDiv}>
189+
<div> Ensure that your project contains the following file: </div>
190+
<pre>
191+
<div className="code-wrapper">
192+
<code>
193+
babel.config.js
194+
</code>
195+
</div>
196+
</pre>
197+
</div>
198+
<div>
199+
and includes the following code:
200+
<br />
201+
</div>
202+
<pre>
203+
<div className="code-wrapper">
204+
<code>
205+
{`module.exports = {presets: ['@babel/preset-env', '@babel/preset-react']}`}
206+
</code>
207+
</div>
208+
</pre>
209+
</AccordionDetails>
210+
</Accordion>
211+
)
212+
}
213+
return null;
214+
}
215+
175216
return (
176217
<ReactModal
177218
className={styles.modal2}
@@ -274,6 +315,8 @@ const Modal = ({
274315
</div>
275316
</AccordionDetails>
276317
</Accordion>
318+
{/* Create config file only if title is react or hook */}
319+
<ReactDependencies />
277320
</div>
278321
</AccordionDetails>
279322
</Accordion>

0 commit comments

Comments
 (0)