Skip to content

Commit 71f68b5

Browse files
committed
Add command and result icons, rerender console when changing theme and font size
1 parent 5762c15 commit 71f68b5

File tree

6 files changed

+51
-10
lines changed

6 files changed

+51
-10
lines changed

client/images/command.svg

Lines changed: 13 additions & 0 deletions
Loading

client/images/result.svg

Lines changed: 22 additions & 0 deletions
Loading

client/modules/App/App.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class App extends React.Component {
4141
render() {
4242
return (
4343
<div className="app">
44-
{false && this.state.isMounted && !window.devToolsExtension && getConfig('NODE_ENV') === 'development' && <DevTools />}
44+
{this.state.isMounted && !window.devToolsExtension && getConfig('NODE_ENV') === 'development' && <DevTools />}
4545
{this.props.children}
4646
</div>
4747
);

client/modules/IDE/components/Console.jsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useRef } from 'react';
1+
import React, { useRef, useEffect } from 'react';
22
import PropTypes from 'prop-types';
33
import { withTranslation } from 'react-i18next';
44

@@ -25,6 +25,9 @@ import infoDarkUrl from '../../../images/console-info-dark.svg?byUrl';
2525
import infoContrastUrl from '../../../images/console-info-contrast.svg?byUrl';
2626
import ConsoleInput from './ConsoleInput';
2727

28+
import commandIconUrl from '../../../images/command.svg?byUrl';
29+
import resultIconUrl from '../../../images/result.svg?byUrl';
30+
2831
import UpArrowIcon from '../../../images/up-arrow.svg';
2932
import DownArrowIcon from '../../../images/down-arrow.svg';
3033

@@ -60,6 +63,8 @@ const getConsoleFeedStyle = (theme, times, fontSize) => {
6063
ARROW_FONT_SIZE: fontSize,
6164
LOG_ICON_WIDTH: fontSize,
6265
LOG_ICON_HEIGHT: 1.45 * fontSize,
66+
LOG_COMMAND_ICON: `url(${commandIconUrl})`,
67+
LOG_RESULT_ICON: `url(${resultIconUrl})`
6368
};
6469

6570
if (times > 1) {
@@ -87,10 +92,10 @@ const Console = ({ t }) => {
8792
collapseConsole, expandConsole, clearConsole, dispatchConsoleEvent
8893
} = bindActionCreators({ ...IDEActions, ...ConsoleActions }, useDispatch());
8994

90-
useDidUpdate(() => {
91-
clearConsole();
92-
dispatchConsoleEvent(consoleEvents);
93-
}, [theme, fontSize]);
95+
// useEffect(() => {
96+
// clearConsole();
97+
// dispatchConsoleEvent(consoleEvents);
98+
// }, [theme, fontSize]);
9499

95100
const cm = useRef({});
96101

@@ -138,6 +143,7 @@ const Console = ({ t }) => {
138143
<ConsoleFeed
139144
styles={getConsoleFeedStyle(theme, times, fontSize)}
140145
logs={[consoleEvent]}
146+
key={Date.now()}
141147
/>
142148
</div>
143149
);

client/styles/components/_console-input.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99

1010
.console__input .console-active__arrow {
1111
width: auto;
12-
height: 55%;
13-
& g {
12+
height: 38%;
13+
& path {
1414
@include themify() {
15-
fill: getThemifyVariable('console-active-arrow-color');
15+
fill: getThemifyVariable('console-active-arrow-color');
16+
opacity: 1;
1617
}
1718
}
1819
}

client/styles/components/_console.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@
135135
height: calc(100% - #{30 / $base-font-size}rem);
136136

137137
.preview-console__message {
138-
flex: 1 0 auto;
139138
position: relative;
140139
@include themify() {
141140
color: getThemifyVariable('console-logged-times-color');

0 commit comments

Comments
 (0)