Skip to content

Commit 795d0a5

Browse files
author
Mat Brown
committed
Output is pure component
1 parent b01efa7 commit 795d0a5

2 files changed

Lines changed: 28 additions & 40 deletions

File tree

src/components/Output.jsx

Lines changed: 28 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,36 @@ import {t} from 'i18next';
44
import classnames from 'classnames';
55
import {ErrorReport, Preview} from '../containers';
66

7-
class Output extends React.Component {
8-
render() {
9-
const {
10-
isDraggingColumnDivider,
11-
isHidden,
12-
style,
13-
onHide,
14-
onRef,
15-
} = this.props;
16-
return (
17-
<div
18-
className={classnames(
19-
'environment__column',
20-
{u__hidden: isHidden},
21-
)}
22-
ref={onRef}
23-
style={Object.assign({}, style, {
24-
pointerEvents: isDraggingColumnDivider ? 'none' : 'all',
25-
})}
26-
>
27-
<div className="environment__columnContents output">
28-
<div
29-
className="environment__label label"
30-
onClick={onHide}
31-
>
32-
{t('workspace.components.output')}
33-
</div>
34-
<Preview />
35-
<ErrorReport />
7+
export default function Output({
8+
isDraggingColumnDivider,
9+
isHidden,
10+
style,
11+
onHide,
12+
onRef,
13+
}) {
14+
return (
15+
<div
16+
className={classnames(
17+
'environment__column',
18+
{u__hidden: isHidden},
19+
)}
20+
ref={onRef}
21+
style={Object.assign({}, style, {
22+
pointerEvents: isDraggingColumnDivider ? 'none' : 'all',
23+
})}
24+
>
25+
<div className="environment__columnContents output">
26+
<div
27+
className="environment__label label"
28+
onClick={onHide}
29+
>
30+
{t('workspace.components.output')}
3631
</div>
32+
<Preview />
33+
<ErrorReport />
3734
</div>
38-
);
39-
}
35+
</div>
36+
);
4037
}
4138

4239
Output.propTypes = {
@@ -46,10 +43,3 @@ Output.propTypes = {
4643
onHide: PropTypes.func.isRequired,
4744
onRef: PropTypes.func.isRequired,
4845
};
49-
50-
Output.defaultProps = {
51-
lastRefreshTimestamp: null,
52-
project: null,
53-
};
54-
55-
export default Output;

src/components/Workspace.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,11 @@ class Workspace extends React.Component {
218218
_renderOutput() {
219219
const {
220220
currentProject: {hiddenUIComponents},
221-
errors,
222221
isDraggingColumnDivider,
223222
rowsFlex,
224223
} = this.props;
225224
return (
226225
<Output
227-
errors={errors}
228226
isDraggingColumnDivider={isDraggingColumnDivider}
229227
isHidden={includes(hiddenUIComponents, 'output')}
230228
style={{flex: rowsFlex[1]}}

0 commit comments

Comments
 (0)