Skip to content

Commit 236a757

Browse files
committed
Reformat devserver
1 parent 0f58149 commit 236a757

17 files changed

+520
-508
lines changed
Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { AnchorButton, Button, Icon, type IconName, Intent } from "@blueprintjs/core";
2-
import React from "react";
1+
import { AnchorButton, Button, Icon, Intent, type IconName } from '@blueprintjs/core';
2+
import React from 'react';
33

44
type ButtonOptions = {
55
className: string;
@@ -8,7 +8,7 @@ type ButtonOptions = {
88
iconOnRight: boolean;
99
intent: Intent;
1010
minimal: boolean;
11-
type?: "submit" | "reset" | "button";
11+
type?: 'submit' | 'reset' | 'button';
1212
};
1313

1414
type ControlButtonProps = {
@@ -20,45 +20,45 @@ type ControlButtonProps = {
2020
};
2121

2222
const defaultOptions = {
23-
className: "",
24-
fullWidth: false,
25-
iconOnRight: false,
26-
intent: Intent.NONE,
27-
minimal: true
23+
className: '',
24+
fullWidth: false,
25+
iconOnRight: false,
26+
intent: Intent.NONE,
27+
minimal: true
2828
};
2929

3030
const ControlButton: React.FC<ControlButtonProps> = ({
31-
label = "",
32-
icon,
33-
onClick,
34-
options = {},
35-
isDisabled = false
31+
label = '',
32+
icon,
33+
onClick,
34+
options = {},
35+
isDisabled = false
3636
}) => {
37-
const buttonOptions: ButtonOptions = {
38-
...defaultOptions,
39-
...options
40-
};
41-
const iconElement = icon && <Icon icon={icon} color={buttonOptions.iconColor} />;
42-
// Refer to #2417 and #2422 for why we conditionally
43-
// set the button component. See also:
44-
// https://blueprintjs.com/docs/#core/components/button
45-
const ButtonComponent = isDisabled ? AnchorButton : Button;
37+
const buttonOptions: ButtonOptions = {
38+
...defaultOptions,
39+
...options
40+
};
41+
const iconElement = icon && <Icon icon={icon} color={buttonOptions.iconColor} />;
42+
// Refer to #2417 and #2422 for why we conditionally
43+
// set the button component. See also:
44+
// https://blueprintjs.com/docs/#core/components/button
45+
const ButtonComponent = isDisabled ? AnchorButton : Button;
4646

47-
return (
48-
<ButtonComponent
49-
disabled={isDisabled}
50-
fill={buttonOptions.fullWidth}
51-
intent={buttonOptions.intent}
52-
minimal={buttonOptions.minimal}
53-
className={buttonOptions.className}
54-
type={buttonOptions.type}
55-
onClick={onClick}
56-
icon={!buttonOptions.iconOnRight && iconElement}
57-
rightIcon={buttonOptions.iconOnRight && iconElement}
58-
>
59-
{label}
60-
</ButtonComponent>
61-
);
47+
return (
48+
<ButtonComponent
49+
disabled={isDisabled}
50+
fill={buttonOptions.fullWidth}
51+
intent={buttonOptions.intent}
52+
minimal={buttonOptions.minimal}
53+
className={buttonOptions.className}
54+
type={buttonOptions.type}
55+
onClick={onClick}
56+
icon={!buttonOptions.iconOnRight && iconElement}
57+
rightIcon={buttonOptions.iconOnRight && iconElement}
58+
>
59+
{label}
60+
</ButtonComponent>
61+
);
6262
};
6363

6464
export default ControlButton;
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Classes } from "@blueprintjs/core";
2-
import classNames from "classnames";
3-
import React, { type JSX } from "react";
1+
import { Classes } from '@blueprintjs/core';
2+
import classNames from 'classnames';
3+
import React, { type JSX } from 'react';
44

55
export type ControlBarProps = {
66
editorButtons: Array<JSX.Element | null>;
@@ -9,29 +9,29 @@ export type ControlBarProps = {
99
};
1010

1111
const ControlBar: React.FC<ControlBarProps> = (props) => {
12-
const editorControl = (
13-
<div className={classNames("ControlBar_editor", Classes.BUTTON_GROUP)}>
14-
{props.editorButtons}
15-
</div>
16-
);
12+
const editorControl = (
13+
<div className={classNames('ControlBar_editor', Classes.BUTTON_GROUP)}>
14+
{props.editorButtons}
15+
</div>
16+
);
1717

18-
const flowControl = props.flowButtons && (
19-
<div className={classNames("ControlBar_flow", Classes.BUTTON_GROUP)}>{props.flowButtons}</div>
20-
);
18+
const flowControl = props.flowButtons && (
19+
<div className={classNames('ControlBar_flow', Classes.BUTTON_GROUP)}>{props.flowButtons}</div>
20+
);
2121

22-
const editingWorkspaceControl = (
23-
<div className={classNames("ControlBar_editingWorkspace", Classes.BUTTON_GROUP)}>
24-
{props.editingWorkspaceButtons}
25-
</div>
26-
);
22+
const editingWorkspaceControl = (
23+
<div className={classNames('ControlBar_editingWorkspace', Classes.BUTTON_GROUP)}>
24+
{props.editingWorkspaceButtons}
25+
</div>
26+
);
2727

28-
return (
29-
<div className="ControlBar">
30-
{editorControl}
31-
{flowControl}
32-
{editingWorkspaceControl}
33-
</div>
34-
);
28+
return (
29+
<div className="ControlBar">
30+
{editorControl}
31+
{flowControl}
32+
{editingWorkspaceControl}
33+
</div>
34+
);
3535
};
3636

3737
export default ControlBar;
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
import { Tooltip2 } from "@blueprintjs/popover2";
2-
import ControlButton from "../ControlButton";
3-
import { IconNames } from "@blueprintjs/icons";
1+
import { IconNames } from '@blueprintjs/icons';
2+
import { Tooltip2 } from '@blueprintjs/popover2';
3+
import ControlButton from '../ControlButton';
44

55
type Props = {
6-
onClick: () => void
7-
}
6+
onClick: () => void;
7+
};
88

9-
export const ControlBarClearButton = (props: Props) => <Tooltip2 content="Clear the editor and context">
10-
<ControlButton
11-
label="Clear"
12-
icon={IconNames.Trash}
13-
onClick={props.onClick}
14-
/>
15-
</Tooltip2>;
9+
export const ControlBarClearButton = (props: Props) => (
10+
<Tooltip2 content="Clear the editor and context">
11+
<ControlButton label="Clear" icon={IconNames.Trash} onClick={props.onClick} />
12+
</Tooltip2>
13+
);
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
import { Tooltip2 } from "@blueprintjs/popover2";
2-
import ControlButton from "../ControlButton";
3-
import { IconNames } from "@blueprintjs/icons";
1+
import { IconNames } from '@blueprintjs/icons';
2+
import { Tooltip2 } from '@blueprintjs/popover2';
3+
import ControlButton from '../ControlButton';
44

55
type Props = {
6-
onClick: () => void
7-
}
6+
onClick: () => void;
7+
};
88

9-
export const ControlBarRefreshButton = (props: Props) => <Tooltip2 content="Manually refresh the side content">
10-
<ControlButton
11-
onClick={props.onClick}
12-
icon={IconNames.Refresh}
13-
label="Refresh"
14-
/>
15-
</Tooltip2>;
9+
export const ControlBarRefreshButton = (props: Props) => (
10+
<Tooltip2 content="Manually refresh the side content">
11+
<ControlButton onClick={props.onClick} icon={IconNames.Refresh} label="Refresh" />
12+
</Tooltip2>
13+
);
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Position } from "@blueprintjs/core";
2-
import { IconNames } from "@blueprintjs/icons";
3-
import { Tooltip2 } from "@blueprintjs/popover2";
4-
import React from "react";
1+
import { Position } from '@blueprintjs/core';
2+
import { IconNames } from '@blueprintjs/icons';
3+
import { Tooltip2 } from '@blueprintjs/popover2';
4+
import React from 'react';
55

6-
import ControlButton from "../ControlButton";
6+
import ControlButton from '../ControlButton';
77

88
type DispatchProps = {
99
handleEditorEval: () => void;
@@ -18,18 +18,18 @@ type StateProps = {
1818
type ControlButtonRunButtonProps = DispatchProps & StateProps;
1919

2020
export const ControlBarRunButton: React.FC<ControlButtonRunButtonProps> = (props) => {
21-
const tooltipContent = "Evaluate the program";
22-
return (
23-
<Tooltip2 content={tooltipContent} placement={Position.TOP}>
24-
<ControlButton
25-
label="Run"
26-
icon={IconNames.PLAY}
27-
onClick={props.handleEditorEval}
28-
options={{
29-
iconColor: props.color,
30-
className: props.className
31-
}}
32-
/>
33-
</Tooltip2>
34-
);
21+
const tooltipContent = 'Evaluate the program';
22+
return (
23+
<Tooltip2 content={tooltipContent} placement={Position.TOP}>
24+
<ControlButton
25+
label="Run"
26+
icon={IconNames.PLAY}
27+
onClick={props.handleEditorEval}
28+
options={{
29+
iconColor: props.color,
30+
className: props.className
31+
}}
32+
/>
33+
</Tooltip2>
34+
);
3535
};

0 commit comments

Comments
 (0)