Skip to content

Commit 7751b3e

Browse files
Merge branch 'develop' into Portuguese-Translation
2 parents 958b6c8 + dd433b7 commit 7751b3e

File tree

4 files changed

+15
-30
lines changed

4 files changed

+15
-30
lines changed

client/components/Nav.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -877,8 +877,6 @@ Nav.propTypes = {
877877
cmController: PropTypes.shape({
878878
tidyCode: PropTypes.func,
879879
showFind: PropTypes.func,
880-
findNext: PropTypes.func,
881-
findPrev: PropTypes.func,
882880
showReplace: PropTypes.func,
883881
getContent: PropTypes.func
884882
}),

client/modules/IDE/components/Editor.jsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ class Editor extends React.Component {
8585
}
8686
}, 2000);
8787
this.showFind = this.showFind.bind(this);
88-
this.findNext = this.findNext.bind(this);
89-
this.findPrev = this.findPrev.bind(this);
9088
this.showReplace = this.showReplace.bind(this);
9189
this.getContent = this.getContent.bind(this);
9290
}
@@ -149,8 +147,8 @@ class Editor extends React.Component {
149147
[`${metaKey}-Enter`]: () => null,
150148
[`Shift-${metaKey}-Enter`]: () => null,
151149
[`${metaKey}-F`]: 'findPersistent',
152-
[`${metaKey}-G`]: 'findNext',
153-
[`Shift-${metaKey}-G`]: 'findPrev',
150+
[`${metaKey}-G`]: 'findPersistentNext',
151+
[`Shift-${metaKey}-G`]: 'findPersistentPrev',
154152
[replaceCommand]: 'replace'
155153
});
156154

@@ -196,8 +194,6 @@ class Editor extends React.Component {
196194
this.props.provideController({
197195
tidyCode: this.tidyCode,
198196
showFind: this.showFind,
199-
findNext: this.findNext,
200-
findPrev: this.findPrev,
201197
showReplace: this.showReplace,
202198
getContent: this.getContent
203199
});
@@ -317,16 +313,6 @@ class Editor extends React.Component {
317313
return updatedFile;
318314
}
319315

320-
findPrev() {
321-
this._cm.focus();
322-
this._cm.execCommand('findPrev');
323-
}
324-
325-
findNext() {
326-
this._cm.focus();
327-
this._cm.execCommand('findNext');
328-
}
329-
330316
showFind() {
331317
this._cm.execCommand('findPersistent');
332318
}

client/modules/IDE/pages/IDEView.jsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,6 @@ class IDEView extends React.Component {
101101
if (nextProps.location !== this.props.location) {
102102
this.props.setPreviousPath(this.props.location.pathname);
103103
}
104-
105-
if (this.props.ide.consoleIsExpanded !== nextProps.ide.consoleIsExpanded) {
106-
this.setState({
107-
consoleSize: nextProps.ide.consoleIsExpanded ? 150 : 29
108-
});
109-
}
110-
111104
if (this.props.ide.sidebarIsExpanded !== nextProps.ide.sidebarIsExpanded) {
112105
this.setState({
113106
sidebarSize: nextProps.ide.sidebarIsExpanded ? 160 : 20
@@ -337,7 +330,9 @@ class IDEView extends React.Component {
337330
<SplitPane
338331
split="horizontal"
339332
primary="second"
340-
size={this.state.consoleSize}
333+
size={
334+
this.props.ide.consoleIsExpanded ? this.state.consoleSize : 29
335+
}
341336
minSize={29}
342337
onChange={(size) => this.setState({ consoleSize: size })}
343338
allowResize={this.props.ide.consoleIsExpanded}

client/test-utils.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/**
22
* This file re-exports @testing-library but ensures that
3-
* any calls to render have translations available.
3+
* any calls to render have translations and theme available.
44
*
55
* This means tested components will be able to call
66
* `t()` and have the translations of the default
7-
* language
7+
* language also components will be able to call
8+
* `prop()` and have the theming of the default theme.
89
*
9-
* See: https://react.i18next.com/misc/testing#testing-without-stubbing
10+
* For i18n see: https://react.i18next.com/misc/testing#testing-without-stubbing
1011
*/
1112

1213
// eslint-disable-next-line import/no-extraneous-dependencies
@@ -15,15 +16,20 @@ import React from 'react';
1516
import PropTypes from 'prop-types';
1617

1718
import { I18nextProvider } from 'react-i18next';
19+
import { ThemeProvider } from 'styled-components';
20+
1821
import i18n from './i18n-test';
22+
import theme, { Theme } from './theme';
1923

2024
// re-export everything
2125
// eslint-disable-next-line import/no-extraneous-dependencies
2226
export * from '@testing-library/react';
2327

2428
const Providers = ({ children }) => (
2529
// eslint-disable-next-line react/jsx-filename-extension
26-
<I18nextProvider i18n={i18n}>{children}</I18nextProvider>
30+
<ThemeProvider theme={{ ...theme[Theme.light] }}>
31+
<I18nextProvider i18n={i18n}>{children}</I18nextProvider>
32+
</ThemeProvider>
2733
);
2834

2935
Providers.propTypes = {

0 commit comments

Comments
 (0)