Skip to content

Commit

Permalink
fixing indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pcross616 committed Mar 30, 2018
1 parent e046ab7 commit 8d60442
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 50 deletions.
86 changes: 43 additions & 43 deletions lib/components/WidgetFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,49 +89,49 @@ const cardTarget = {
isDragging: monitor.isDragging(),
}))
class WidgetFrame extends Component {
render() {
const {
frameComponent,
children,
editable,
title,
frameSettings,
connectDragSource,
connectDropTarget,
isDragging,
} = this.props;

let selected = null;

if (frameComponent) {
// if user provided a custom frame, use it
selected = createElement(frameComponent, {
children,
editable,
title,
settings: frameSettings,
onRemove: this.remove,
});
} else {
// else use the default frame
selected = (
<DefaultFrame
title={title}
editable={editable}
children={children}
onRemove={this.remove}
/>
);
}
const opacity = isDragging ? 0 : 1;
const widgetFrame = (
<div style={{ opacity }}>
{selected}
</div>
);

return editable ? connectDragSource(connectDropTarget(widgetFrame)) : widgetFrame;
}
render() {
const {
frameComponent,
children,
editable,
title,
frameSettings,
connectDragSource,
connectDropTarget,
isDragging,
} = this.props;

let selected = null;

if (frameComponent) {
// if user provided a custom frame, use it
selected = createElement(frameComponent, {
children,
editable,
title,
settings: frameSettings,
onRemove: this.remove,
});
} else {
// else use the default frame
selected = (
<DefaultFrame
title={title}
editable={editable}
children={children}
onRemove={this.remove}
/>
);
}
const opacity = isDragging ? 0 : 1;
const widgetFrame = (
<div style={{ opacity }}>
{selected}
</div>
);

return editable ? connectDragSource(connectDropTarget(widgetFrame)) : widgetFrame;
}

remove = () => {
const { layout, rowIndex, columnIndex, widgetIndex } = this.props;
Expand Down
14 changes: 7 additions & 7 deletions test/components/WidgetFrame.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ describe('<WidgetFrame />', () => {
});

it('Customized frame should be provided with necessary props', () => {
let children = [];
let editable = false;
let onRemove = () => {};
let title = 'Widget Title';
let OriginalWidgetFrame = WidgetFrame.DecoratedComponent;
let identity = (el) => el;
let settings = {
const children = [];
const editable = false;
const onRemove = () => {};
const title = 'Widget Title';
const OriginalWidgetFrame = WidgetFrame.DecoratedComponent;
const identity = (el) => el;
const settings = {
color: '#E140AD',
};
const component = mount(
Expand Down

0 comments on commit 8d60442

Please sign in to comment.